From 2b190108de64ee0b70da0a05cade3800897e22a6 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 19 Dec 2018 16:36:47 -0500 Subject: [PATCH 01/17] Refine Order for Web3 compat. & add conversions Changed some of the fields in the Order class so that it can be passed to our contracts via Web3. Added conversion utilities so that an Order can be easily converted to and from a JSON-compatible dict (specifically by encoding/decoding the `bytes` fields), to facilitate validation against the JSON schema. Also modified JSON order schema to accept integers in addition to stringified integers. --- .../schemas/whole_number_schema.json | 11 +- .../src/zero_ex/order_utils/__init__.py | 169 ++++++++++++++---- .../test/test_generate_order_hash_hex.py | 4 +- .../order_utils/test/test_json_schemas.py | 6 +- 4 files changed, 154 insertions(+), 36 deletions(-) diff --git a/packages/json-schemas/schemas/whole_number_schema.json b/packages/json-schemas/schemas/whole_number_schema.json index 944ce820ee..aa469954ca 100644 --- a/packages/json-schemas/schemas/whole_number_schema.json +++ b/packages/json-schemas/schemas/whole_number_schema.json @@ -1,5 +1,12 @@ { "id": "/wholeNumberSchema", - "type": "string", - "pattern": "^\\d+$" + "anyOf": [ + { + "type": "string", + "pattern": "^\\d+$" + }, + { + "type": "integer" + } + ] } 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 24c6bfd4e8..b18e5bb0a8 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 @@ -10,9 +10,10 @@ fence smart topic"``. """ +from copy import copy from enum import auto, Enum import json -from typing import Dict, Tuple +from typing import cast, Dict, Tuple from pkg_resources import resource_string from mypy_extensions import TypedDict @@ -107,47 +108,154 @@ class SignatureType(Enum): class Order(TypedDict): # pylint: disable=too-many-instance-attributes - """Object representation of a 0x order.""" + """A Web3-compatible representation of the Exchange.Order struct.""" makerAddress: str takerAddress: str feeRecipientAddress: str senderAddress: str - makerAssetAmount: str - takerAssetAmount: str - makerFee: str - takerFee: str - expirationTimeSeconds: str - salt: str - makerAssetData: str - takerAssetData: str - exchangeAddress: str + makerAssetAmount: int + takerAssetAmount: int + makerFee: int + takerFee: int + expirationTimeSeconds: int + salt: int + makerAssetData: bytes + takerAssetData: bytes def make_empty_order() -> Order: """Construct an empty order. - Initializes all strings to "0x0000000000000000000000000000000000000000" - and all numbers to 0. + Initializes all strings to "0x0000000000000000000000000000000000000000", + all numbers to 0, and all bytes to nulls. """ return { "makerAddress": _Constants.null_address, "takerAddress": _Constants.null_address, "senderAddress": _Constants.null_address, "feeRecipientAddress": _Constants.null_address, - "makerAssetData": _Constants.null_address, - "takerAssetData": _Constants.null_address, - "salt": "0", - "makerFee": "0", - "takerFee": "0", - "makerAssetAmount": "0", - "takerAssetAmount": "0", - "expirationTimeSeconds": "0", - "exchangeAddress": _Constants.null_address, + "makerAssetData": (b"\x00") * 20, + "takerAssetData": (b"\x00") * 20, + "salt": 0, + "makerFee": 0, + "takerFee": 0, + "makerAssetAmount": 0, + "takerAssetAmount": 0, + "expirationTimeSeconds": 0, } -def generate_order_hash_hex(order: Order) -> str: +def order_to_jsdict( + order: Order, exchange_address="0x0000000000000000000000000000000000000000" +) -> dict: + """Convert a Web3-compatible order struct to a JSON-schema-compatible dict. + + More specifically, do explicit decoding for the `bytes` fields. + + >>> import pprint + >>> pprint.pprint(order_to_jsdict( + ... { + ... 'makerAddress': "0x0000000000000000000000000000000000000000", + ... 'takerAddress': "0x0000000000000000000000000000000000000000", + ... 'feeRecipientAddress': + ... "0x0000000000000000000000000000000000000000", + ... 'senderAddress': "0x0000000000000000000000000000000000000000", + ... 'makerAssetAmount': 1, + ... 'takerAssetAmount': 1, + ... 'makerFee': 0, + ... 'takerFee': 0, + ... 'expirationTimeSeconds': 1, + ... 'salt': 1, + ... 'makerAssetData': (0).to_bytes(1, byteorder='big') * 20, + ... 'takerAssetData': (0).to_bytes(1, byteorder='big') * 20, + ... }, + ... )) + {'exchangeAddress': '0x0000000000000000000000000000000000000000', + 'expirationTimeSeconds': 1, + 'feeRecipientAddress': '0x0000000000000000000000000000000000000000', + 'makerAddress': '0x0000000000000000000000000000000000000000', + 'makerAssetAmount': 1, + 'makerAssetData': '0x0000000000000000000000000000000000000000', + 'makerFee': 0, + 'salt': 1, + 'senderAddress': '0x0000000000000000000000000000000000000000', + 'takerAddress': '0x0000000000000000000000000000000000000000', + 'takerAssetAmount': 1, + 'takerAssetData': '0x0000000000000000000000000000000000000000', + 'takerFee': 0} + """ + jsdict = cast(Dict, copy(order)) + + # encode bytes fields + jsdict["makerAssetData"] = "0x" + order["makerAssetData"].hex() + jsdict["takerAssetData"] = "0x" + order["takerAssetData"].hex() + + jsdict["exchangeAddress"] = exchange_address + + assert_valid(jsdict, "/orderSchema") + + return jsdict + + +def jsdict_order_to_struct(jsdict: dict) -> Order: + r"""Convert a JSON-schema-compatible dict order to a Web3-compatible struct. + + More specifically, do explicit encoding of the `bytes` fields. + + >>> import pprint + >>> pprint.pprint(jsdict_order_to_struct( + ... { + ... 'makerAddress': "0x0000000000000000000000000000000000000000", + ... 'takerAddress': "0x0000000000000000000000000000000000000000", + ... 'feeRecipientAddress': "0x0000000000000000000000000000000000000000", + ... 'senderAddress': "0x0000000000000000000000000000000000000000", + ... 'makerAssetAmount': 1000000000000000000, + ... 'takerAssetAmount': 1000000000000000000, + ... 'makerFee': 0, + ... 'takerFee': 0, + ... 'expirationTimeSeconds': 12345, + ... 'salt': 12345, + ... 'makerAssetData': "0x0000000000000000000000000000000000000000", + ... 'takerAssetData': "0x0000000000000000000000000000000000000000", + ... 'exchangeAddress': "0x0000000000000000000000000000000000000000", + ... }, + ... )) + {'expirationTimeSeconds': 12345, + 'feeRecipientAddress': '0x0000000000000000000000000000000000000000', + 'makerAddress': '0x0000000000000000000000000000000000000000', + 'makerAssetAmount': 1000000000000000000, + 'makerAssetData': b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + b'\x00\x00\x00\x00\x00\x00\x00\x00', + 'makerFee': 0, + 'salt': 12345, + 'senderAddress': '0x0000000000000000000000000000000000000000', + 'takerAddress': '0x0000000000000000000000000000000000000000', + 'takerAssetAmount': 1000000000000000000, + 'takerAssetData': b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + b'\x00\x00\x00\x00\x00\x00\x00\x00', + 'takerFee': 0} + """ # noqa: E501 (line too long) + assert_valid(jsdict, "/orderSchema") + + order = cast(Order, copy(jsdict)) + + def strip_0x(hex_string: str) -> str: + if hex_string.startswith("0x"): + return hex_string[2:] + return hex_string + + order["makerAssetData"] = bytes.fromhex(strip_0x(jsdict["makerAssetData"])) + order["takerAssetData"] = bytes.fromhex(strip_0x(jsdict["takerAssetData"])) + + del order["exchangeAddress"] # type: ignore + # silence mypy pending release of + # https://github.com/python/mypy/issues/3550 + + return order + + +def generate_order_hash_hex(order: Order, exchange_address: str) -> str: """Calculate the hash of the given order as a hexadecimal string. :param order: The order to be hashed. Must conform to `the 0x order JSON schema `_. @@ -167,14 +275,15 @@ def generate_order_hash_hex(order: Order) -> str: ... 'takerFee': "0", ... 'expirationTimeSeconds': "12345", ... 'salt': "12345", - ... 'makerAssetData': "0x0000000000000000000000000000000000000000", - ... 'takerAssetData': "0x0000000000000000000000000000000000000000", - ... 'exchangeAddress': "0x0000000000000000000000000000000000000000", + ... 'makerAssetData': (0).to_bytes(1, byteorder='big') * 20, + ... 'takerAssetData': (0).to_bytes(1, byteorder='big') * 20, ... }, + ... exchange_address="0x0000000000000000000000000000000000000000", ... ) '55eaa6ec02f3224d30873577e9ddd069a288c16d6fb407210eecbc501fa76692' """ # noqa: E501 (line too long) - assert_valid(order, "/orderSchema") + assert_is_address(exchange_address, "exchange_address") + assert_valid(order_to_jsdict(order, exchange_address), "/orderSchema") def pad_20_bytes_to_32(twenty_bytes: bytes): return bytes(12) + twenty_bytes @@ -184,7 +293,7 @@ def int_to_32_big_endian_bytes(i: int): eip712_domain_struct_hash = keccak( _Constants.eip712_domain_struct_header - + pad_20_bytes_to_32(to_bytes(hexstr=order["exchangeAddress"])) + + pad_20_bytes_to_32(to_bytes(hexstr=exchange_address)) ) eip712_order_struct_hash = keccak( @@ -199,8 +308,8 @@ def int_to_32_big_endian_bytes(i: int): + int_to_32_big_endian_bytes(int(order["takerFee"])) + int_to_32_big_endian_bytes(int(order["expirationTimeSeconds"])) + int_to_32_big_endian_bytes(int(order["salt"])) - + keccak(to_bytes(hexstr=order["makerAssetData"])) - + keccak(to_bytes(hexstr=order["takerAssetData"])) + + keccak(to_bytes(hexstr=order["makerAssetData"].hex())) + + keccak(to_bytes(hexstr=order["takerAssetData"].hex())) ) return keccak( diff --git a/python-packages/order_utils/test/test_generate_order_hash_hex.py b/python-packages/order_utils/test/test_generate_order_hash_hex.py index 6869a40ed3..38b503289b 100644 --- a/python-packages/order_utils/test/test_generate_order_hash_hex.py +++ b/python-packages/order_utils/test/test_generate_order_hash_hex.py @@ -8,5 +8,7 @@ def test_get_order_hash_hex__empty_order(): expected_hash_hex = ( "faa49b35faeb9197e9c3ba7a52075e6dad19739549f153b77dfcf59408a4b422" ) - actual_hash_hex = generate_order_hash_hex(make_empty_order()) + actual_hash_hex = generate_order_hash_hex( + make_empty_order(), "0x0000000000000000000000000000000000000000" + ) assert actual_hash_hex == expected_hash_hex diff --git a/python-packages/order_utils/test/test_json_schemas.py b/python-packages/order_utils/test/test_json_schemas.py index 51cecbd4f5..8178169f64 100644 --- a/python-packages/order_utils/test/test_json_schemas.py +++ b/python-packages/order_utils/test/test_json_schemas.py @@ -1,7 +1,7 @@ """Tests of zero_ex.json_schemas""" -from zero_ex.order_utils import make_empty_order +from zero_ex.order_utils import make_empty_order, order_to_jsdict from zero_ex.json_schemas import _LOCAL_RESOLVER, assert_valid @@ -15,9 +15,9 @@ def test_assert_valid_caches_resources(): """ _LOCAL_RESOLVER._remote_cache.cache_clear() # pylint: disable=W0212 - assert_valid(make_empty_order(), "/orderSchema") + assert_valid(order_to_jsdict(make_empty_order()), "/orderSchema") cache_info = ( _LOCAL_RESOLVER._remote_cache.cache_info() # pylint: disable=W0212 ) assert cache_info.currsize == 4 - assert cache_info.hits == 10 + assert cache_info.hits > 0 From f1224b7344a73500525472c783c9ca9425d47cf3 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 2 Jan 2019 15:06:13 -0500 Subject: [PATCH 02/17] Fixes for json_schemas Has-types indicator file was not being included in package. Schemas were not being properly gathered into package installation. --- python-packages/order_utils/setup.py | 11 +++- .../src/zero_ex/json_schemas/py.typed | 0 .../src/zero_ex/json_schemas/schemas | 1 - .../json_schemas/schemas/address_schema.json | 5 ++ .../asset_pairs_request_opts_schema.json | 8 +++ .../schemas/block_param_schema.json | 11 ++++ .../schemas/block_range_schema.json | 8 +++ .../schemas/call_data_schema.json | 27 ++++++++++ .../ec_signature_parameter_schema.json | 5 ++ .../schemas/ec_signature_schema.json | 14 +++++ .../schemas/eip712_typed_data_schema.json | 28 ++++++++++ .../json_schemas/schemas/hex_schema.json | 5 ++ .../schemas/index_filter_values_schema.json | 7 +++ .../json_schemas/schemas/js_number.json | 5 ++ .../json_schemas/schemas/number_schema.json | 5 ++ .../schemas/order_cancel_schema.json | 12 +++++ .../schemas/order_config_request_schema.json | 24 +++++++++ .../order_fill_or_kill_requests_schema.json | 12 +++++ .../schemas/order_fill_requests_schema.json | 12 +++++ .../schemas/order_hash_schema.json | 5 ++ .../json_schemas/schemas/order_schema.json | 34 ++++++++++++ ...der_watcher_web_socket_request_schema.json | 52 +++++++++++++++++++ ...atcher_web_socket_utf8_message_schema.json | 10 ++++ .../schemas/orderbook_request_schema.json | 9 ++++ .../schemas/orders_request_opts_schema.json | 19 +++++++ .../json_schemas/schemas/orders_schema.json | 5 ++ .../schemas/paged_request_opts_schema.json | 8 +++ .../schemas/paginated_collection_schema.json | 10 ++++ ..._api_asset_data_pairs_response_schema.json | 13 +++++ .../relayer_api_asset_data_pairs_schema.json | 12 +++++ ...ayer_api_asset_data_trade_info_schema.json | 11 ++++ .../relayer_api_error_response_schema.json | 21 ++++++++ ...er_api_fee_recipients_response_schema.json | 16 ++++++ ...layer_api_order_config_payload_schema.json | 24 +++++++++ ...ayer_api_order_config_response_schema.json | 11 ++++ .../schemas/relayer_api_order_schema.json | 9 ++++ ...relayer_api_orderbook_response_schema.json | 9 ++++ ...ders_channel_subscribe_payload_schema.json | 14 +++++ ...r_api_orders_channel_subscribe_schema.json | 11 ++++ ...orders_channel_update_response_schema.json | 11 ++++ .../relayer_api_orders_response_schema.json | 13 +++++ .../schemas/relayer_api_orders_schema.json | 5 ++ .../schemas/request_opts_schema.json | 7 +++ .../schemas/signed_order_schema.json | 12 +++++ .../schemas/signed_orders_schema.json | 5 ++ .../json_schemas/schemas/token_schema.json | 11 ++++ .../json_schemas/schemas/tx_data_schema.json | 26 ++++++++++ .../schemas/whole_number_schema.json | 12 +++++ .../schemas/zero_ex_transaction_schema.json | 10 ++++ 49 files changed, 613 insertions(+), 2 deletions(-) create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/py.typed delete mode 120000 python-packages/order_utils/src/zero_ex/json_schemas/schemas create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/address_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/asset_pairs_request_opts_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_param_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_range_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/call_data_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_parameter_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/eip712_typed_data_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/hex_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/index_filter_values_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/js_number.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/number_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_cancel_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_config_request_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_or_kill_requests_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_requests_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_hash_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_request_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_utf8_message_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/orderbook_request_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_request_opts_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/paged_request_opts_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/paginated_collection_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_response_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_trade_info_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_error_response_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_fee_recipients_response_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_payload_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_response_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orderbook_response_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_update_response_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_response_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/request_opts_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_order_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_orders_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/token_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/tx_data_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/whole_number_schema.json create mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/zero_ex_transaction_schema.json diff --git a/python-packages/order_utils/setup.py b/python-packages/order_utils/setup.py index 125de5ff7d..61405caa28 100755 --- a/python-packages/order_utils/setup.py +++ b/python-packages/order_utils/setup.py @@ -42,6 +42,15 @@ def run(self): "mypy src test setup.py".split(), # security issue checker: "bandit -r src ./setup.py".split(), + # ensure json schemas don't differ from the authoritative copies: + # this is a hack. ideally we would symlink to the authoritative + # copies, but a problem with setuptools is preventing it from + # following symlinks when gathering package_data. see + # https://github.com/pypa/setuptools/issues/415. + ( + "diff src/zero_ex/json_schemas/schemas" + + " ../../packages/json-schemas/schemas" + ).split(), # general linter: "pylint src test setup.py".split(), # pylint takes relatively long to run, so it runs last, to enable @@ -198,7 +207,7 @@ def run(self): package_data={ "zero_ex.order_utils": ["py.typed"], "zero_ex.contract_artifacts": ["artifacts/*"], - "zero_ex.json_schemas": ["schemas/*"], + "zero_ex.json_schemas": ["py.typed", "schemas/*"], }, package_dir={"": "src"}, license="Apache 2.0", diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/py.typed b/python-packages/order_utils/src/zero_ex/json_schemas/py.typed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas b/python-packages/order_utils/src/zero_ex/json_schemas/schemas deleted file mode 120000 index b8257372c3..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas +++ /dev/null @@ -1 +0,0 @@ -../../../../../packages/json-schemas/schemas/ \ No newline at end of file diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/address_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/address_schema.json new file mode 100644 index 0000000000..0dc02d3313 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/address_schema.json @@ -0,0 +1,5 @@ +{ + "id": "/addressSchema", + "type": "string", + "pattern": "^0x[0-9a-f]{40}$" +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/asset_pairs_request_opts_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/asset_pairs_request_opts_schema.json new file mode 100644 index 0000000000..174a8fdc32 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/asset_pairs_request_opts_schema.json @@ -0,0 +1,8 @@ +{ + "id": "/AssetPairsRequestOpts", + "type": "object", + "properties": { + "assetDataA": { "$ref": "/hexSchema" }, + "assetDataB": { "$ref": "/hexSchema" } + } +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_param_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_param_schema.json new file mode 100644 index 0000000000..ed4dd1e875 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_param_schema.json @@ -0,0 +1,11 @@ +{ + "id": "/blockParamSchema", + "oneOf": [ + { + "type": "number" + }, + { + "enum": ["latest", "earliest", "pending"] + } + ] +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_range_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_range_schema.json new file mode 100644 index 0000000000..b142946490 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/call_data_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/call_data_schema.json new file mode 100644 index 0000000000..c5972e8c18 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_parameter_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_parameter_schema.json new file mode 100644 index 0000000000..0c08ec2403 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_schema.json new file mode 100644 index 0000000000..bc79ca5e96 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/eip712_typed_data_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/eip712_typed_data_schema.json new file mode 100644 index 0000000000..8efd6de448 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/hex_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/hex_schema.json new file mode 100644 index 0000000000..f37815d5bd --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/index_filter_values_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/index_filter_values_schema.json new file mode 100644 index 0000000000..bec00d79e8 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/js_number.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/js_number.json new file mode 100644 index 0000000000..6a72d92c07 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/js_number.json @@ -0,0 +1,5 @@ +{ + "id": "/jsNumber", + "type": "number", + "minimum": 0 +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/number_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/number_schema.json new file mode 100644 index 0000000000..a48f3e8cff --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/number_schema.json @@ -0,0 +1,5 @@ +{ + "id": "/numberSchema", + "type": "string", + "pattern": "^\\d+(\\.\\d+)?$" +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_cancel_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_cancel_schema.json new file mode 100644 index 0000000000..8d0999941a --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_config_request_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_config_request_schema.json new file mode 100644 index 0000000000..ca9b2e30ee --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_config_request_schema.json @@ -0,0 +1,24 @@ +{ + "id": "/OrderConfigRequest", + "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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_or_kill_requests_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_or_kill_requests_schema.json new file mode 100644 index 0000000000..73bbf20bb1 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_requests_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_requests_schema.json new file mode 100644 index 0000000000..d06fb19a29 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_hash_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_hash_schema.json new file mode 100644 index 0000000000..4a770579fc --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_schema.json new file mode 100644 index 0000000000..c70b9e2ddf --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_request_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_request_schema.json new file mode 100644 index 0000000000..b0c419f94f --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_request_schema.json @@ -0,0 +1,52 @@ +{ + "id": "/orderWatcherWebSocketRequestSchema", + "type": "object", + "definitions": { + "signedOrderParam": { + "type": "object", + "properties": { + "signedOrder": { "$ref": "/signedOrderSchema" } + }, + "required": ["signedOrder"] + }, + "orderHashParam": { + "type": "object", + "properties": { + "orderHash": { "$ref": "/hexSchema" } + }, + "required": ["orderHash"] + } + }, + "oneOf": [ + { + "type": "object", + "properties": { + "id": { "type": "number" }, + "jsonrpc": { "type": "string" }, + "method": { "enum": ["ADD_ORDER"] }, + "params": { "$ref": "#/definitions/signedOrderParam" } + }, + "required": ["id", "jsonrpc", "method", "params"] + }, + { + "type": "object", + "properties": { + "id": { "type": "number" }, + "jsonrpc": { "type": "string" }, + "method": { "enum": ["REMOVE_ORDER"] }, + "params": { "$ref": "#/definitions/orderHashParam" } + }, + "required": ["id", "jsonrpc", "method", "params"] + }, + { + "type": "object", + "properties": { + "id": { "type": "number" }, + "jsonrpc": { "type": "string" }, + "method": { "enum": ["GET_STATS"] }, + "params": {} + }, + "required": ["id", "jsonrpc", "method"] + } + ] +} \ No newline at end of file diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_utf8_message_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_utf8_message_schema.json new file mode 100644 index 0000000000..154d6d754d --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_utf8_message_schema.json @@ -0,0 +1,10 @@ +{ + "id": "/orderWatcherWebSocketUtf8MessageSchema", + "properties": { + "utf8Data": { "type": "string" } + }, + "required": [ + "utf8Data" + ], + "type": "object" +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orderbook_request_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orderbook_request_schema.json new file mode 100644 index 0000000000..27848bdcb1 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orderbook_request_schema.json @@ -0,0 +1,9 @@ +{ + "id": "/OrderBookRequest", + "type": "object", + "properties": { + "baseAssetData": { "$ref": "/hexSchema" }, + "quoteAssetData": { "$ref": "/hexSchema" } + }, + "required": ["baseAssetData", "quoteAssetData"] +} \ No newline at end of file diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_request_opts_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_request_opts_schema.json new file mode 100644 index 0000000000..10da510607 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_request_opts_schema.json @@ -0,0 +1,19 @@ +{ + "id": "/OrdersRequestOpts", + "type": "object", + "properties": { + "makerAssetProxyId": { "$ref": "/hexSchema" }, + "takerAssetProxyId": { "$ref": "/hexSchema" }, + "makerAssetAddress": { "$ref": "/addressSchema" }, + "takerAssetAddress": { "$ref": "/addressSchema" }, + "exchangeAddress": { "$ref": "/addressSchema" }, + "senderAddress": { "$ref": "/addressSchema" }, + "makerAssetData": { "$ref": "/hexSchema" }, + "takerAssetData": { "$ref": "/hexSchema" }, + "traderAssetData": { "$ref": "/hexSchema" }, + "makerAddress": { "$ref": "/addressSchema" }, + "takerAddress": { "$ref": "/addressSchema" }, + "traderAddress": { "$ref": "/addressSchema" }, + "feeRecipientAddress": { "$ref": "/addressSchema" } + } +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_schema.json new file mode 100644 index 0000000000..1e1c6a8751 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_schema.json @@ -0,0 +1,5 @@ +{ + "id": "/ordersSchema", + "type": "array", + "items": { "$ref": "/orderSchema" } +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/paged_request_opts_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/paged_request_opts_schema.json new file mode 100644 index 0000000000..7cfc73947b --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/paged_request_opts_schema.json @@ -0,0 +1,8 @@ +{ + "id": "/PagedRequestOpts", + "type": "object", + "properties": { + "page": { "type": "number" }, + "perPage": { "type": "number" } + } +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/paginated_collection_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/paginated_collection_schema.json new file mode 100644 index 0000000000..9dcedf5b47 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_response_schema.json new file mode 100644 index 0000000000..d1150d3dbc --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_schema.json new file mode 100644 index 0000000000..62d4745b8c --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_trade_info_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_trade_info_schema.json new file mode 100644 index 0000000000..e0f274c5d8 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_error_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_error_response_schema.json new file mode 100644 index 0000000000..be4659b0bd --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_fee_recipients_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_fee_recipients_response_schema.json new file mode 100644 index 0000000000..c73506dbb1 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_payload_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_payload_schema.json new file mode 100644 index 0000000000..f4583fc625 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_response_schema.json new file mode 100644 index 0000000000..8193861e12 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_schema.json new file mode 100644 index 0000000000..e0f6539b9f --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orderbook_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orderbook_response_schema.json new file mode 100644 index 0000000000..b44f2a7408 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json new file mode 100644 index 0000000000..274ef1625a --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_schema.json new file mode 100644 index 0000000000..29561d09fc --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_update_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_update_response_schema.json new file mode 100644 index 0000000000..239e7c5861 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_response_schema.json new file mode 100644 index 0000000000..a5023a3fc1 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_schema.json new file mode 100644 index 0000000000..84e75cd045 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_schema.json @@ -0,0 +1,5 @@ +{ + "id": "/relayerApiOrdersSchema", + "type": "array", + "items": { "$ref": "/relayerApiOrderSchema" } +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/request_opts_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/request_opts_schema.json new file mode 100644 index 0000000000..b50547d180 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/request_opts_schema.json @@ -0,0 +1,7 @@ +{ + "id": "/RequestOpts", + "type": "object", + "properties": { + "networkId": { "type": "number" } + } +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_order_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_order_schema.json new file mode 100644 index 0000000000..137ae4a249 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_orders_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_orders_schema.json new file mode 100644 index 0000000000..e7c3a0b6c9 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_orders_schema.json @@ -0,0 +1,5 @@ +{ + "id": "/signedOrdersSchema", + "type": "array", + "items": { "$ref": "/signedOrderSchema" } +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/token_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/token_schema.json new file mode 100644 index 0000000000..31e41c4b87 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/tx_data_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/tx_data_schema.json new file mode 100644 index 0000000000..4643521ce4 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/whole_number_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/whole_number_schema.json new file mode 100644 index 0000000000..aa469954ca --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/whole_number_schema.json @@ -0,0 +1,12 @@ +{ + "id": "/wholeNumberSchema", + "anyOf": [ + { + "type": "string", + "pattern": "^\\d+$" + }, + { + "type": "integer" + } + ] +} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/zero_ex_transaction_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/zero_ex_transaction_schema.json new file mode 100644 index 0000000000..0c714f14d9 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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" +} From 4676af65369f048a363ed54032c3ca8803560eb5 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 19 Dec 2018 18:09:08 -0500 Subject: [PATCH 03/17] Add test/demo of Exchange.getOrderInfo() --- .circleci/config.yml | 20 +++ python-packages/contract_demo/.discharge.json | 13 ++ python-packages/contract_demo/README.md | 39 +++++ python-packages/contract_demo/setup.py | 144 ++++++++++++++++++ .../contract_demo/stubs/__init__.pyi | 0 .../contract_demo/stubs/command/__init__.pyi | 0 .../contract_demo/stubs/command/clean.pyi | 7 + .../stubs/distutils/__init__.pyi | 0 .../stubs/distutils/command/__init__.pyi | 0 .../stubs/distutils/command/clean.pyi | 7 + .../stubs/eth_utils/__init__.pyi | 4 + .../contract_demo/stubs/pytest/__init__.pyi | 0 .../stubs/setuptools/__init__.pyi | 8 + .../stubs/setuptools/command/__init__.pyi | 0 .../stubs/setuptools/command/test.pyi | 3 + .../contract_demo/stubs/web3/__init__.pyi | 2 + .../stubs/web3/utils/__init__.pyi | 0 .../stubs/web3/utils/datatypes.pyi | 3 + .../contract_demo/test/__init__.py | 1 + python-packages/contract_demo/test/conf.py | 54 +++++++ .../contract_demo/test/doc_static/.gitkeep | 0 python-packages/contract_demo/test/index.rst | 18 +++ .../contract_demo/test/test_exchange.py | 62 ++++++++ .../src/zero_ex/order_utils/__init__.py | 10 +- 24 files changed, 394 insertions(+), 1 deletion(-) create mode 100644 python-packages/contract_demo/.discharge.json create mode 100644 python-packages/contract_demo/README.md create mode 100755 python-packages/contract_demo/setup.py create mode 100644 python-packages/contract_demo/stubs/__init__.pyi create mode 100644 python-packages/contract_demo/stubs/command/__init__.pyi create mode 100644 python-packages/contract_demo/stubs/command/clean.pyi create mode 100644 python-packages/contract_demo/stubs/distutils/__init__.pyi create mode 100644 python-packages/contract_demo/stubs/distutils/command/__init__.pyi create mode 100644 python-packages/contract_demo/stubs/distutils/command/clean.pyi create mode 100644 python-packages/contract_demo/stubs/eth_utils/__init__.pyi create mode 100644 python-packages/contract_demo/stubs/pytest/__init__.pyi create mode 100644 python-packages/contract_demo/stubs/setuptools/__init__.pyi create mode 100644 python-packages/contract_demo/stubs/setuptools/command/__init__.pyi create mode 100644 python-packages/contract_demo/stubs/setuptools/command/test.pyi create mode 100644 python-packages/contract_demo/stubs/web3/__init__.pyi create mode 100644 python-packages/contract_demo/stubs/web3/utils/__init__.pyi create mode 100644 python-packages/contract_demo/stubs/web3/utils/datatypes.pyi create mode 100644 python-packages/contract_demo/test/__init__.py create mode 100644 python-packages/contract_demo/test/conf.py create mode 100644 python-packages/contract_demo/test/doc_static/.gitkeep create mode 100644 python-packages/contract_demo/test/index.rst create mode 100644 python-packages/contract_demo/test/test_exchange.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 68d8041a2d..0d3176a2f7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -219,6 +219,10 @@ jobs: - '.mypy_cache' - '.pytest_cache' - '.tox' + - run: + command: | + cd python-packages/contract_demo + coverage run setup.py test - run: command: | cd python-packages/order_utils @@ -227,6 +231,10 @@ jobs: command: | cd python-packages/sra_client coverage run setup.py test + - save_cache: + key: coverage-python-contract-demo-{{ .Environment.CIRCLE_SHA1 }} + paths: + - ~/repo/python-packages/contract_demo/.coverage - save_cache: key: coverage-python-order-utils-{{ .Environment.CIRCLE_SHA1 }} paths: @@ -273,6 +281,11 @@ jobs: - 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/contract_demo + python -m ensurepip + python -m pip install .[dev] - run: command: | cd python-packages/order_utils @@ -283,6 +296,10 @@ jobs: paths: - '/usr/local/bin' - '/usr/local/lib/python3.7/site-packages' + - run: + command: | + cd python-packages/contract_demo + python setup.py lint - run: command: | cd python-packages/order_utils @@ -355,6 +372,9 @@ jobs: - restore_cache: keys: - coverage-contracts-{{ .Environment.CIRCLE_SHA1 }} + - restore_cache: + keys: + - coverage-python-contract-demo-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: keys: - coverage-python-order-utils-{{ .Environment.CIRCLE_SHA1 }} diff --git a/python-packages/contract_demo/.discharge.json b/python-packages/contract_demo/.discharge.json new file mode 100644 index 0000000000..9d811ae3e6 --- /dev/null +++ b/python-packages/contract_demo/.discharge.json @@ -0,0 +1,13 @@ +{ + "domain": "0x-contract-demo-py", + "build_command": "python setup.py build_sphinx", + "upload_directory": "build/docs/html", + "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/python-packages/contract_demo/README.md b/python-packages/contract_demo/README.md new file mode 100644 index 0000000000..3a0f964e30 --- /dev/null +++ b/python-packages/contract_demo/README.md @@ -0,0 +1,39 @@ +## 0x-contract-demo + +A demonstration of calling 0x smart contracts from Python. + +Read the [documentation](http://0x-contract-demo-py.s3-website-us-east-1.amazonaws.com/) + +## 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/contract_demo/setup.py b/python-packages/contract_demo/setup.py new file mode 100755 index 0000000000..e04b5ab72d --- /dev/null +++ b/python-packages/contract_demo/setup.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python + +"""setuptools module for 0x-contract-demo package.""" + +import distutils.command.build_py +from distutils.command.clean import clean +import subprocess # nosec +from shutil import rmtree +from os import environ, path +from sys import argv + +from setuptools import setup +from setuptools.command.test import test as TestCommand + + +class TestCommandExtension(TestCommand): + """Run pytest tests.""" + + def run_tests(self): + """Invoke pytest.""" + import pytest + + exit(pytest.main()) + + +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 = [ + # formatter: + "black --line-length 79 --check --diff test setup.py".split(), + # style guide checker (formerly pep8): + "pycodestyle test setup.py".split(), + # docstring style checker: + "pydocstyle test setup.py".split(), + # static type checker: + "mypy test setup.py".split(), + # security issue checker: + "bandit -r ./setup.py".split(), + # general linter: + "pylint test setup.py".split(), + # 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" + ) + + for lint_command in lint_commands: + print( + "Running lint command `", " ".join(lint_command).strip(), "`" + ) + subprocess.check_call(lint_command) # nosec + + +class CleanCommandExtension(clean): + """Custom command to do custom cleanup.""" + + def run(self): + """Run the regular clean, followed by our custom commands.""" + super().run() + rmtree(".mypy_cache", ignore_errors=True) + rmtree(".tox", ignore_errors=True) + rmtree(".pytest_cache", ignore_errors=True) + + +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:2.2.2".split() + subprocess.call(cmd_line) # nosec + + +class PublishDocsCommand(distutils.command.build_py.build_py): + """Custom command to publish docs to S3.""" + + description = ( + "Publish docs to " + + "http://0x-contract-addresses-py.s3-website-us-east-1.amazonaws.com/" + ) + + def run(self): + """Run npm package `discharge` to build & upload docs.""" + subprocess.check_call("discharge deploy".split()) # nosec + + +setup( + name="0x-contract-demo", + version="1.0.0", + description="Demonstration of calling 0x contracts", + url=( + "https://github.com/0xProject/0x-monorepo/tree/development" + + "/python-packages/contract_demo" + ), + author="F. Eugene Aumson", + author_email="feuGeneA@users.noreply.github.com", + cmdclass={ + "clean": CleanCommandExtension, + "lint": LintCommand, + "test": TestCommandExtension, + "ganache": GanacheCommand, + "publish_docs": PublishDocsCommand, + }, + install_requires=[ + "0x-order-utils", + "0x-web3", # TEMPORARY! pending resolution of our web3.py PR#1147 + "mypy_extensions", + ], + extras_require={ + "dev": [ + "bandit", + "black", + "coverage", + "coveralls", + "mypy", + "mypy_extensions", + "pycodestyle", + "pydocstyle", + "pylint", + "pytest", + "sphinx", + "tox", + ] + }, + python_requires=">=3.6, <4", + license="Apache 2.0", + zip_safe=False, # required per mypy + command_options={ + "build_sphinx": { + "source_dir": ("setup.py", "test"), + "build_dir": ("setup.py", "build/docs"), + } + }, +) diff --git a/python-packages/contract_demo/stubs/__init__.pyi b/python-packages/contract_demo/stubs/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_demo/stubs/command/__init__.pyi b/python-packages/contract_demo/stubs/command/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_demo/stubs/command/clean.pyi b/python-packages/contract_demo/stubs/command/clean.pyi new file mode 100644 index 0000000000..46a42ddb13 --- /dev/null +++ b/python-packages/contract_demo/stubs/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/contract_demo/stubs/distutils/__init__.pyi b/python-packages/contract_demo/stubs/distutils/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_demo/stubs/distutils/command/__init__.pyi b/python-packages/contract_demo/stubs/distutils/command/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_demo/stubs/distutils/command/clean.pyi b/python-packages/contract_demo/stubs/distutils/command/clean.pyi new file mode 100644 index 0000000000..46a42ddb13 --- /dev/null +++ b/python-packages/contract_demo/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/contract_demo/stubs/eth_utils/__init__.pyi b/python-packages/contract_demo/stubs/eth_utils/__init__.pyi new file mode 100644 index 0000000000..4a83338cad --- /dev/null +++ b/python-packages/contract_demo/stubs/eth_utils/__init__.pyi @@ -0,0 +1,4 @@ +from typing import Union + +def to_checksum_address(value: Union[str, bytes]) -> str: + ... diff --git a/python-packages/contract_demo/stubs/pytest/__init__.pyi b/python-packages/contract_demo/stubs/pytest/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_demo/stubs/setuptools/__init__.pyi b/python-packages/contract_demo/stubs/setuptools/__init__.pyi new file mode 100644 index 0000000000..8ea8d32b7e --- /dev/null +++ b/python-packages/contract_demo/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/contract_demo/stubs/setuptools/command/__init__.pyi b/python-packages/contract_demo/stubs/setuptools/command/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_demo/stubs/setuptools/command/test.pyi b/python-packages/contract_demo/stubs/setuptools/command/test.pyi new file mode 100644 index 0000000000..c5ec770ad3 --- /dev/null +++ b/python-packages/contract_demo/stubs/setuptools/command/test.pyi @@ -0,0 +1,3 @@ +from setuptools import Command + +class test(Command): ... diff --git a/python-packages/contract_demo/stubs/web3/__init__.pyi b/python-packages/contract_demo/stubs/web3/__init__.pyi new file mode 100644 index 0000000000..21482d598a --- /dev/null +++ b/python-packages/contract_demo/stubs/web3/__init__.pyi @@ -0,0 +1,2 @@ +class Web3: + ... diff --git a/python-packages/contract_demo/stubs/web3/utils/__init__.pyi b/python-packages/contract_demo/stubs/web3/utils/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_demo/stubs/web3/utils/datatypes.pyi b/python-packages/contract_demo/stubs/web3/utils/datatypes.pyi new file mode 100644 index 0000000000..70baff3728 --- /dev/null +++ b/python-packages/contract_demo/stubs/web3/utils/datatypes.pyi @@ -0,0 +1,3 @@ +class Contract: + def call(self): ... + ... diff --git a/python-packages/contract_demo/test/__init__.py b/python-packages/contract_demo/test/__init__.py new file mode 100644 index 0000000000..600f143bf1 --- /dev/null +++ b/python-packages/contract_demo/test/__init__.py @@ -0,0 +1 @@ +"""Demonstrations of calling 0x smart contracts.""" diff --git a/python-packages/contract_demo/test/conf.py b/python-packages/contract_demo/test/conf.py new file mode 100644 index 0000000000..45ed4b2a53 --- /dev/null +++ b/python-packages/contract_demo/test/conf.py @@ -0,0 +1,54 @@ +"""Configuration file for the Sphinx documentation builder.""" + +# 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 = "0x-contract-demo" +# pylint: disable=redefined-builtin +copyright = "2018, ZeroEx, Intl." +author = "F. Eugene Aumson" +version = pkg_resources.get_distribution("0x-contract-demo").version +release = "" # The full version, including alpha/beta/rc tags + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.viewcode", +] + +templates_path = ["doc_templates"] + +source_suffix = ".rst" +# eg: source_suffix = [".rst", ".md"] + +master_doc = "index" # The master toctree document. + +language = None + +exclude_patterns: List[str] = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = None + +html_theme = "alabaster" + +html_static_path = ["doc_static"] +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". + +# Output file base name for HTML help builder. +htmlhelp_basename = "contract_demopydoc" + +# -- Extension configuration: + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {"https://docs.python.org/": None} diff --git a/python-packages/contract_demo/test/doc_static/.gitkeep b/python-packages/contract_demo/test/doc_static/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_demo/test/index.rst b/python-packages/contract_demo/test/index.rst new file mode 100644 index 0000000000..c546eccfa3 --- /dev/null +++ b/python-packages/contract_demo/test/index.rst @@ -0,0 +1,18 @@ +.. source for the sphinx-generated build/docs/web/index.html + +Python demo of 0x Smart Contracts +================================= + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + +.. automodule:: test.test_exchange + :members: + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/python-packages/contract_demo/test/test_exchange.py b/python-packages/contract_demo/test/test_exchange.py new file mode 100644 index 0000000000..0ecd0e3b45 --- /dev/null +++ b/python-packages/contract_demo/test/test_exchange.py @@ -0,0 +1,62 @@ +"""Test calling methods on the Exchange contract.""" + +from eth_utils import to_checksum_address +from web3 import Web3 +from web3.utils import datatypes + +from zero_ex.json_schemas import assert_valid +from zero_ex.order_utils import ( + _Constants, + Order, + OrderInfo, + order_to_jsdict, + generate_order_hash_hex, +) + + +def test_get_order_info(): + """Demonstrate Exchange.getOrderInfo().""" + order: Order = { + "makerAddress": "0x0000000000000000000000000000000000000000", + "takerAddress": "0x0000000000000000000000000000000000000000", + "feeRecipientAddress": "0x0000000000000000000000000000000000000000", + "senderAddress": "0x0000000000000000000000000000000000000000", + "makerAssetAmount": 1000000000000000000, + "takerAssetAmount": 1000000000000000000, + "makerFee": 0, + "takerFee": 0, + "expirationTimeSeconds": 12345, + "salt": 12345, + "makerAssetData": (b"\x00") * 20, + "takerAssetData": (b"\x00") * 20, + } + + web3_instance = Web3(Web3.HTTPProvider("http://127.0.0.1:8545")) + + # false positive from pylint: disable=no-member + network_id = web3_instance.net.version + contract_address = _Constants.network_to_exchange_addr[network_id] + + assert_valid( + order_to_jsdict(order, exchange_address=contract_address), + "/orderSchema", + ) + + # false positive from pylint: disable=no-member + exchange: datatypes.Contract = web3_instance.eth.contract( + address=to_checksum_address(contract_address), + abi=_Constants.contract_name_to_abi("Exchange"), + ) + + order_info = OrderInfo(*exchange.call().getOrderInfo(order)) + + assert isinstance(order_info.order_status, int) + assert order_info.order_status == 4 + + assert isinstance(order_info.order_hash, bytes) + assert order_info.order_hash.hex() == generate_order_hash_hex( + order, exchange_address=_Constants.network_to_exchange_addr["50"] + ) + + assert isinstance(order_info.order_taker_asset_filled_amount, int) + assert order_info.order_taker_asset_filled_amount == 0 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 b18e5bb0a8..38dd65d3e8 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 @@ -13,7 +13,7 @@ from copy import copy from enum import auto, Enum import json -from typing import cast, Dict, Tuple +from typing import cast, Dict, NamedTuple, Tuple from pkg_resources import resource_string from mypy_extensions import TypedDict @@ -319,6 +319,14 @@ def int_to_32_big_endian_bytes(i: int): ).hex() +class OrderInfo(NamedTuple): + """A Web3-compatible representation of the Exchange.OrderInfo struct.""" + + order_status: str + order_hash: bytes + order_taker_asset_filled_amount: int + + def is_valid_signature( provider: BaseProvider, data: str, signature: str, signer_address: str ) -> Tuple[bool, str]: From c88723c6bdc19fe0e2ca074e063c19c044129901 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 2 Jan 2019 16:04:32 -0500 Subject: [PATCH 04/17] web3 bug workaround --- python-packages/order_utils/setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python-packages/order_utils/setup.py b/python-packages/order_utils/setup.py index 61405caa28..1556f5a6df 100755 --- a/python-packages/order_utils/setup.py +++ b/python-packages/order_utils/setup.py @@ -182,6 +182,8 @@ def run(self): install_requires=[ "eth-abi", "eth_utils", + "hypothesis>=3.31.2", # HACK! this is web3's dependency! + # above works around https://github.com/ethereum/web3.py/issues/1179 "jsonschema", "mypy_extensions", "web3", From 2045bb8b167c00f92b46216eca1af29cd89d39ab Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 2 Jan 2019 16:29:23 -0500 Subject: [PATCH 05/17] Fix problem packaging contract artifacts --- python-packages/order_utils/setup.py | 9 + .../src/zero_ex/contract_artifacts/artifacts | 1 - .../artifacts/AssetProxyOwner.json | 699 ++++++ .../artifacts/DummyERC20Token.json | 328 +++ .../artifacts/DummyERC721Token.json | 375 ++++ .../artifacts/ERC20Proxy.json | 195 ++ .../artifacts/ERC20Token.json | 189 ++ .../artifacts/ERC721Proxy.json | 195 ++ .../artifacts/ERC721Token.json | 268 +++ .../artifacts/Exchange.json | 1981 +++++++++++++++++ .../artifacts/Forwarder.json | 447 ++++ .../artifacts/IValidator.json | 41 + .../contract_artifacts/artifacts/IWallet.json | 37 + .../artifacts/OrderValidator.json | 572 +++++ .../contract_artifacts/artifacts/WETH9.json | 293 +++ .../artifacts/ZRXToken.json | 227 ++ 16 files changed, 5856 insertions(+), 1 deletion(-) delete mode 120000 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/AssetProxyOwner.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/DummyERC20Token.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/DummyERC721Token.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC20Proxy.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC20Token.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC721Proxy.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC721Token.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/Exchange.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/Forwarder.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/IValidator.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/IWallet.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/OrderValidator.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/WETH9.json create mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ZRXToken.json diff --git a/python-packages/order_utils/setup.py b/python-packages/order_utils/setup.py index 1556f5a6df..5954339a8c 100755 --- a/python-packages/order_utils/setup.py +++ b/python-packages/order_utils/setup.py @@ -51,6 +51,15 @@ def run(self): "diff src/zero_ex/json_schemas/schemas" + " ../../packages/json-schemas/schemas" ).split(), + # ensure contract artifacts match the authoritative copies: + # this is a hack. ideally we would symlink to the authoritative + # copies, but a problem with setuptools is preventing it from + # following symlinks when gathering package_data. see + # https://github.com/pypa/setuptools/issues/415. + ( + "diff src/zero_ex/contract_artifacts/artifacts" + + " ../../packages/contract-artifacts/artifacts" + ).split(), # general linter: "pylint src test setup.py".split(), # pylint takes relatively long to run, so it runs last, to enable diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts deleted file mode 120000 index 82d28ba87c..0000000000 --- a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts +++ /dev/null @@ -1 +0,0 @@ -../../../../../packages/contract-artifacts/artifacts \ No newline at end of file diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/AssetProxyOwner.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/AssetProxyOwner.json new file mode 100644 index 0000000000..e5fad3aefe --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/AssetProxyOwner.json @@ -0,0 +1,699 @@ +{ + "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" + } + } + }, + "networks": {} +} diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/DummyERC20Token.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/DummyERC20Token.json new file mode 100644 index 0000000000..7b8e7c3a8c --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/DummyERC20Token.json @@ -0,0 +1,328 @@ +{ + "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" + } + } + }, + "networks": {} +} diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/DummyERC721Token.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/DummyERC721Token.json new file mode 100644 index 0000000000..7472a5a03a --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/DummyERC721Token.json @@ -0,0 +1,375 @@ +{ + "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" + } + } + }, + "networks": {} +} diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC20Proxy.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC20Proxy.json new file mode 100644 index 0000000000..33af866e70 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC20Proxy.json @@ -0,0 +1,195 @@ +{ + "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" + } + } + }, + "networks": {} +} diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC20Token.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC20Token.json new file mode 100644 index 0000000000..d89d08a77d --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC20Token.json @@ -0,0 +1,189 @@ +{ + "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" + } + } + }, + "networks": {} +} diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC721Proxy.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC721Proxy.json new file mode 100644 index 0000000000..db01e40f0f --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC721Proxy.json @@ -0,0 +1,195 @@ +{ + "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" + } + } + }, + "networks": {} +} diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC721Token.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC721Token.json new file mode 100644 index 0000000000..d189090e83 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC721Token.json @@ -0,0 +1,268 @@ +{ + "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" + } + } + }, + "networks": {} +} diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/Exchange.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/Exchange.json new file mode 100644 index 0000000000..6e586b8994 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/Exchange.json @@ -0,0 +1,1981 @@ +{ + "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": + "0x60806040526000805460ff191690553480156200001b57600080fd5b5060405162005ec038038062005ec083398101806040526200004191908101906200044d565b80518190620000589060019060208401906200034c565b5050604080517f454950373132446f6d61696e28000000000000000000000000000000000000006020808301919091527f737472696e67206e616d652c0000000000000000000000000000000000000000602d8301527f737472696e672076657273696f6e2c000000000000000000000000000000000060398301527f6164647265737320766572696679696e67436f6e74726163740000000000000060488301527f2900000000000000000000000000000000000000000000000000000000000000606183015282516042818403018152606290920192839052815191929182918401908083835b60208310620001625780518252601f19909201916020918201910162000141565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208285018552600b8084527f30782050726f746f636f6c000000000000000000000000000000000000000000928401928352945190965091945090928392508083835b60208310620001ec5780518252601f199092019160209182019101620001cb565b51815160209384036101000a600019018019909216911617905260408051929094018290038220828501855260018084527f3200000000000000000000000000000000000000000000000000000000000000928401928352945190965091945090928392508083835b60208310620002765780518252601f19909201916020918201910162000255565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208282019890985281840196909652606081019690965250306080808701919091528151808703909101815260a09095019081905284519093849350850191508083835b60208310620003015780518252601f199092019160209182019101620002e0565b5181516000196020949094036101000a939093019283169219169190911790526040519201829003909120600255505060038054600160a060020a03191633179055506200050f9050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200038f57805160ff1916838001178555620003bf565b82800160010185558215620003bf579182015b82811115620003bf578251825591602001919060010190620003a2565b50620003cd929150620003d1565b5090565b620003ee91905b80821115620003cd5760008155600101620003d8565b90565b6000601f820183136200040357600080fd5b81516200041a6200041482620004b4565b6200048d565b915080825260208301602083018583830111156200043757600080fd5b62000444838284620004dc565b50505092915050565b6000602082840312156200046057600080fd5b81516001604060020a038111156200047757600080fd5b6200048584828501620003f1565b949350505050565b6040518181016001604060020a0381118282101715620004ac57600080fd5b604052919050565b60006001604060020a03821115620004cb57600080fd5b506020601f91909101601f19160190565b60005b83811015620004f9578181015183820152602001620004df565b8381111562000509576000848401525b50505050565b6159a1806200051f6000396000f3006080604052600436106101b65763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663288cdc9181146101bb578063297bb70b146101f15780632ac126221461021e5780633683ef8e1461024b5780633c28d8611461026d5780633e228bae1461029a5780633fd3c997146102ba5780634ac14782146102e75780634d0ae546146103075780634f9559b11461032757806350dde190146103475780636070410814610367578063642f2eaf1461039457806364a3bc15146103b457806377fcce68146103d45780637b8e3514146103f45780637e1d9808146104145780637e9d74dc1461043457806382c174d0146104615780638da5cb5b146104815780639363470214610496578063a3e20380146104b6578063b4be83d5146104d6578063bfc8bfce146104f6578063c585bb9314610516578063c75e0a8114610536578063d46b02c314610563578063d9bfa73e14610583578063db123b1a146105a3578063dd1c7d18146105c5578063e306f779146105e5578063e5fa431b146105fa578063eea086ba1461061a578063f2fde38b1461062f578063ffa1ad741461064f575b600080fd5b3480156101c757600080fd5b506101db6101d63660046148ee565b610664565b6040516101e89190615513565b60405180910390f35b3480156101fd57600080fd5b5061021161020c366004614811565b610676565b6040516101e891906157ed565b34801561022a57600080fd5b5061023e6102393660046148ee565b6107a1565b6040516101e89190615505565b34801561025757600080fd5b5061026b61026636600461492b565b6107b6565b005b34801561027957600080fd5b5061028d610288366004614a5f565b6108a3565b6040516101e891906157fb565b3480156102a657600080fd5b506102116102b5366004614b1f565b610a3a565b3480156102c657600080fd5b506102da6102d53660046149ee565b610a90565b6040516101e891906155cf565b3480156102f357600080fd5b5061026b6103023660046147dc565b610ab8565b34801561031357600080fd5b50610211610322366004614811565b610b85565b34801561033357600080fd5b5061026b6103423660046148ee565b610c75565b34801561035357600080fd5b50610211610362366004614811565b610e2a565b34801561037357600080fd5b506103876103823660046149ee565b610ebe565b6040516101e89190615425565b3480156103a057600080fd5b5061023e6103af3660046148ee565b610f0c565b3480156103c057600080fd5b506102116103cf366004614b1f565b610f21565b3480156103e057600080fd5b5061026b6103ef3660046147ac565b610fcc565b34801561040057600080fd5b5061023e61040f366004614772565b611106565b34801561042057600080fd5b5061021161042f3660046148a5565b611126565b34801561044057600080fd5b5061045461044f3660046147dc565b61128a565b6040516101e891906154f4565b34801561046d57600080fd5b5061023e61047c36600461490c565b61131f565b34801561048d57600080fd5b5061038761133f565b3480156104a257600080fd5b5061023e6104b1366004614993565b61135b565b3480156104c257600080fd5b506102116104d13660046148a5565b6118de565b3480156104e257600080fd5b506102116104f1366004614b1f565b6119f1565b34801561050257600080fd5b5061026b610511366004614b68565b611a6c565b34801561052257600080fd5b5061026b610531366004614754565b611d05565b34801561054257600080fd5b50610556610551366004614a2a565b611f30565b6040516101e8919061580a565b34801561056f57600080fd5b5061026b61057e366004614a2a565b61202a565b34801561058f57600080fd5b506101db61059e366004614772565b6120c6565b3480156105af57600080fd5b506105b86120e3565b6040516101e891906155be565b3480156105d157600080fd5b506102116105e03660046148a5565b61218e565b3480156105f157600080fd5b506101db612263565b34801561060657600080fd5b506102116106153660046148a5565b612269565b34801561062657600080fd5b506103876123db565b34801561063b57600080fd5b5061026b61064a366004614754565b6123f7565b34801561065b57600080fd5b506105b86124a8565b60046020526000908152604090205481565b61067e614386565b600080610689614386565b60005460ff16156106cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558751935091505b81831461076f57610758878381518110151561071957fe5b90602001906020020151878481518110151561073157fe5b90602001906020020151878581518110151561074957fe5b906020019060200201516124df565b9050610764848261257d565b600190910190610701565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055509392505050565b60056020526000908152604090205460ff1681565b73ffffffffffffffffffffffffffffffffffffffff831633146108465761080e848484848080601f0160208091040260200160405190810160405280939291908181526020018383808284375061135b945050505050565b1515610846576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061569d565b5050600091825260076020908152604080842073ffffffffffffffffffffffffffffffffffffffff9093168452919052902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b6108ab6143af565b6108b36143de565b6108bb6143de565b6000805460ff16156108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561016080890151610140808a01919091528901519088015261094588611f30565b925061095087611f30565b915061095a6125df565b905061096888848389612611565b61097487838388612611565b61097e88886127a9565b610992888885604001518560400151612809565b8051602081015190519195506109ad918a9186918190612990565b6020808501519081015190516109c99189918591908190612990565b6109e28882856020015186604001518860000151612aa9565b6109fb8782846020015185604001518860200151612aa9565b610a0788888387612b55565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550949350505050565b610a42614386565b6060610a4f858585612d2d565b9050608081825160208401305af48015610a8657815183526020820151602084015260408201516040840152606082015160608401525b505b509392505050565b600b6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60008054819060ff1615610af8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558151905b808214610b5857610b508382815181101515610b4157fe5b90602001906020020151612eff565b600101610b29565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b610b8d614386565b600080610b98614386565b60005460ff1615610bd5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558751935091505b81831461076f57610c5e8783815181101515610c1f57fe5b906020019060200201518784815181101515610c3757fe5b906020019060200201518785815181101515610c4f57fe5b90602001906020020151612f2a565b9050610c6a848261257d565b600190910190610c07565b6000805481908190819060ff1615610cb9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610cec6125df565b935073ffffffffffffffffffffffffffffffffffffffff84163314610d115733610d14565b60005b73ffffffffffffffffffffffffffffffffffffffff8086166000908152600660209081526040808320938516835292905220549093506001860192509050808211610d8b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061572d565b73ffffffffffffffffffffffffffffffffffffffff80851660008181526006602090815260408083209488168084529490915290819020859055517f82af639571738f4ebd4268fb0363d8957ebe1bbb9e78dba5ebd69eed39b154f090610df3908690615513565b60405180910390a35050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055505050565b610e32614386565b600080610e3d614386565b86519250600091505b818314610eb457610e9d8783815181101515610e5e57fe5b906020019060200201518784815181101515610e7657fe5b906020019060200201518785815181101515610e8e57fe5b90602001906020020151610a3a565b9050610ea9848261257d565b600190910190610e46565b5050509392505050565b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff165b919050565b60096020526000908152604090205460ff1681565b610f29614386565b60005460ff1615610f66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610f9c848484612f2a565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055949350505050565b6000805460ff161561100a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561103d6125df565b73ffffffffffffffffffffffffffffffffffffffff8181166000818152600860209081526040808320948916808452949091529081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168715151790555192935090917fa8656e308026eeabce8f0bc18048433252318ab80ac79da0b3d3d8697dfba891906110d1908690615505565b60405180910390a35050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b600860209081526000928352604080842090915290825290205460ff1681565b61112e614386565b6060600080600061113d614386565b60005460ff161561117a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117815589518a919081106111b257fe5b906020019060200201516101600151945088519350600092505b828414611255578489848151811015156111e257fe5b906020019060200201516101600181905250611202888760200151612f7d565b915061122e898481518110151561121557fe5b9060200190602002015183898681518110151561074957fe5b905061123a868261257d565b6020860151881161124a57611255565b6001909201916111cc565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055509195945050505050565b606060006060600084519250826040519080825280602002602001820160405280156112d057816020015b6112bd6143de565b8152602001906001900390816112b55790505b509150600090505b808314610a88576112ff85828151811015156112f057fe5b90602001906020020151611f30565b828281518110151561130d57fe5b602090810290910101526001016112d8565b600760209081526000928352604080842090915290825290205460ff1681565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600080600089511115156113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061571d565b6113ad89612fc4565b7f010000000000000000000000000000000000000000000000000000000000000090049650600760ff88161061140f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061563d565b8660ff16600781111561141e57fe5b9550600086600781111561142e57fe5b1415611466576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061570d565b600186600781111561147457fe5b14156114bc578851156114b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157dd565b600097506118d0565b60028660078111156114ca57fe5b141561160557885160411461150b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155dd565b88600081518110151561151a57fe5b01602001517f010000000000000000000000000000000000000000000000000000000000000090819004810204945061155a89600163ffffffff61308816565b935061156d89602163ffffffff61308816565b925060018b86868660405160008152602001604052604051611592949392919061556e565b60206040516020810390808403906000865af11580156115b6573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015173ffffffffffffffffffffffffffffffffffffffff8c811690821614995092506118d09050565b600386600781111561161357fe5b14156117b9578851604114611654576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155dd565b88600081518110151561166357fe5b01602001517f01000000000000000000000000000000000000000000000000000000000000009081900481020494506116a389600163ffffffff61308816565b93506116b689602163ffffffff61308816565b925060018b60405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b6020831061175757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161171a565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040805192909401829003822060008352910192839052611592945092508991899150889061556e565b60048660078111156117c757fe5b14156117df576117d88b8b8b6130d3565b97506118d0565b60058660078111156117ed57fe5b1415611850576117fc89613228565b73ffffffffffffffffffffffffffffffffffffffff808c1660009081526008602090815260408083209385168352929052205490915060ff16151561184457600097506118d0565b6117d8818c8c8c6132a1565b600686600781111561185e57fe5b141561189e5760008b815260076020908152604080832073ffffffffffffffffffffffffffffffffffffffff8e16845290915290205460ff1697506118d0565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061563d565b505050505050509392505050565b6118e6614386565b60606000806000806118f6614386565b89600081518110151561190557fe5b906020019060200201516101400151955089519450600093505b8385146119e457858a8581518110151561193557fe5b6020908102909101015161014001528651611951908a90612f7d565b92506119948a8581518110151561196457fe5b9060200190602002015160a001518b8681518110151561198057fe5b9060200190602002015160800151856133fd565b91506119c08a858151811015156119a757fe5b90602001906020020151838a87815181101515610e8e57fe5b90506119cc878261257d565b865189116119d9576119e4565b60019093019261191f565b5050505050509392505050565b6119f9614386565b60005460ff1615611a36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610f9c8484846124df565b600a5460009073ffffffffffffffffffffffffffffffffffffffff1615611abf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b611b02611afd888888888080601f01602080910402602001604051908101604052809392919081815260200183838082843750613453945050505050565b613694565b60008181526009602052604090205490915060ff1615611b4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061568d565b73ffffffffffffffffffffffffffffffffffffffff86163314611c1f57611ba6818785858080601f0160208091040260200160405190810160405280939291908181526020018383808284375061135b945050505050565b1515611bde576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157cd565b600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555b6000818152600960205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555130908690869080838380828437820191505092505050600060405180830381855af49150501515611cb6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156bd565b73ffffffffffffffffffffffffffffffffffffffff86163314611cfc57600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b50505050505050565b6003546000908190819073ffffffffffffffffffffffffffffffffffffffff163314611d5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061577d565b8392508273ffffffffffffffffffffffffffffffffffffffff1663ae25532e6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015611dc457600080fd5b505af1158015611dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dfc9190810190614a0c565b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152600b602052604090205490925073ffffffffffffffffffffffffffffffffffffffff1690508015611e81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061561d565b7fffffffff0000000000000000000000000000000000000000000000000000000082166000908152600b60205260409081902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8616179055517fd2c6b762299c609bdb96520b58a49bfb80186934d4f71a86a367571a15c0319490611f2290849087906155a3565b60405180910390a150505050565b611f386143de565b611f41826136d1565b6020808301829052600091825260049052604090819020549082015260808201511515611f755760015b60ff168152610f07565b60a08201511515611f87576002611f6b565b60a0820151604082015110611f9d576005611f6b565b6101008201514210611fb0576004611f6b565b60208082015160009081526005909152604090205460ff1615611fd4576006611f6b565b610120820151825173ffffffffffffffffffffffffffffffffffffffff90811660009081526006602090815260408083206060880151909416835292905220541115612021576006611f6b565b60038152919050565b60005460ff1615612067576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561209b81612eff565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600660209081526000928352604080842090915290825290205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156121865780601f1061215b57610100808354040283529160200191612186565b820191906000526020600020905b81548152906001019060200180831161216957829003601f168201915b505050505081565b612196614386565b606060008060006121a5614386565b8860008151811015156121b457fe5b906020019060200201516101600151945088519350600092505b828414612257578489848151811015156121e457fe5b906020019060200201516101600181905250612204888760200151612f7d565b9150612230898481518110151561221757fe5b90602001906020020151838986815181101515610e8e57fe5b905061223c868261257d565b6020860151881161224c57612257565b6001909201916121ce565b50505050509392505050565b60025481565b612271614386565b6060600080600080612281614386565b60005460ff16156122be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061576d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781558a518b919081106122f657fe5b906020019060200201516101400151955089519450600093505b8385146123a557858a8581518110151561232657fe5b6020908102909101015161014001528651612342908a90612f7d565b92506123558a8581518110151561196457fe5b91506123818a8581518110151561236857fe5b90602001906020020151838a8781518110151561074957fe5b905061238d878261257d565b8651891161239a576123a5565b600190930192612310565b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550929695505050505050565b600a5473ffffffffffffffffffffffffffffffffffffffff1681565b60035473ffffffffffffffffffffffffffffffffffffffff163314612448576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061577d565b73ffffffffffffffffffffffffffffffffffffffff8116156124a557600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b60408051808201909152600581527f322e302e30000000000000000000000000000000000000000000000000000000602082015281565b6124e7614386565b6124ef6143de565b60008060006124fd88611f30565b93506125076125df565b925061251588858589612611565b6125278860a001518560400151612f7d565b915061253387836136df565b9050612546888589848960000151612990565b61255088826136f5565b945061256788848660200151876040015189612aa9565b612572888487613756565b505050509392505050565b8151815161258b9190613864565b8252602080830151908201516125a19190613864565b6020830152604080830151908201516125ba9190613864565b6040830152606080830151908201516125d39190613864565b60609092019190915250565b600a5460009073ffffffffffffffffffffffffffffffffffffffff16818115612608578161260a565b335b9392505050565b825160ff1660031461264f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061579d565b606084015173ffffffffffffffffffffffffffffffffffffffff16156126c257606084015173ffffffffffffffffffffffffffffffffffffffff1633146126c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157ad565b602084015173ffffffffffffffffffffffffffffffffffffffff161561274d578173ffffffffffffffffffffffffffffffffffffffff16846020015173ffffffffffffffffffffffffffffffffffffffff1614151561274d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155ed565b604083015115156127a35761276b836020015185600001518361135b565b15156127a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061565d565b50505050565b6127bb8260a001518260a001516138ae565b6127cd836080015183608001516138ae565b1015612805576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157bd565b5050565b6128116143af565b6000806000806128258960a0015188612f7d565b935061283a89608001518a60a0015186613909565b925061284a8860a0015187612f7d565b915061285f88608001518960a0015184613909565b90508084106128a25760208086018051839052805182018490525151865182015260808a015160a08b015187519092015161289a9290613909565b8551526128df565b845183905284516020908101859052855181015190860180519190915260a089015160808a01519151516128d69290613986565b60208087015101525b84515160208087015101516128f49190612f7d565b604086015284515160808a015160c08b0151612911929190613909565b85516040015284516020015160a08a015160e08b0151612932929190613909565b855160600152602085015151608089015160c08a0151612953929190613909565b8560200151604001818152505061297b8560200151602001518960a001518a60e00151613909565b60208601516060015250505050949350505050565b8215156129c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156dd565b82821115612a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156cd565b8460a00151612a16856040015184613864565b1115612a4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906155fd565b612a5c8560800151836138ae565b612a6a828760a001516138ae565b1115612aa2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061575d565b5050505050565b612ab7828260200151613864565b600084815260046020908152604091829020929092558681015187518451938501518584015160608701516101408c01516101608d015196518b9873ffffffffffffffffffffffffffffffffffffffff9788169897909616967f0bcc4c97732e47d9946f229edb95f5b6323f601300e4690de719993f3c37112996612b46968f96339692959194909390615433565b60405180910390a45050505050565b60018054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101008789161502019095169490940493840181900481028201810190925282815260609390929091830182828015612bfe5780601f10612bd357610100808354040283529160200191612bfe565b820191906000526020600020905b815481529060010190602001808311612be157829003601f168201915b50505050509050612c2685610140015186600001518660000151856020015160200151613a23565b61014084015184518651845160200151612c4293929190613a23565b612c5b8561014001518660000151858560400151613a23565b612c778186600001518760400151856000015160400151613a23565b612c938185600001518660400151856020015160400151613a23565b836040015173ffffffffffffffffffffffffffffffffffffffff16856040015173ffffffffffffffffffffffffffffffffffffffff161415612cfd57612cf881848760400151612cf3866000015160600151876020015160600151613864565b613a23565b612aa2565b612d1581848760400151856000015160600151613a23565b612aa281848660400151856020015160600151613a23565b604080517fb4be83d5000000000000000000000000000000000000000000000000000000006020808301919091526060602483018181528751608485019081528884015160a48601529488015160c48501529087015160e4840152608087015161010484015260a087015161012484015260c087015161014484015260e08701516101648401526101008701516101848401526101208701516101a4840152610140870180516101c485019081526101608901516101e4860152610180905251805161020485018190529394919384936044870192849261022489019291820191601f82010460005b81811015612e34578351855260209485019490930192600101612e16565b50505050818103610160808401919091528a0151805180835260209283019291820191601f82010460005b81811015612e7d578351855260209485019490930192600101612e5f565b50505089845250848103602093840190815288518083529093918201918981019190601f82010460005b81811015612ec5578351855260209485019490930192600101612ea7565b5050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08883030188525060405250505050509392505050565b612f076143de565b612f1082611f30565b9050612f1c8282613bed565b612805828260200151613d04565b612f32614386565b612f3d8484846124df565b6020810151909150831461260a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061574d565b600082821115612fb9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061560d565b508082035b92915050565b6000808251111515613002576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156fd565b815182907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061303257fe5b016020015182517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01909252507f0100000000000000000000000000000000000000000000000000000000000000908190040290565b6000816020018351101515156130ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061562d565b50016020015190565b6040516000906060907f1626ba7e000000000000000000000000000000000000000000000000000000009061310e908790869060240161554e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093178352815191935090829081885afa8080156131ab576001811461321c57612572565b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0c57414c4c45545f4552524f5200000000000000000000000000000000604052600060605260646000fd5b50505195945050505050565b60006014825110151515613268576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061578d565b613276826014845103613dab565b82517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec019092525090565b6040516000906060907f9363470200000000000000000000000000000000000000000000000000000000906132de90879087908790602401615521565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931783528151919350908290818a5afa80801561337b57600181146133ec576133f1565b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f56414c494441544f525f4552524f5200000000000000000000000000604052600060605260646000fd5b825194505b50505050949350505050565b6000808311613438576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b61344b61344585846138ae565b84613e0c565b949350505050565b604080517f5a65726f45785472616e73616374696f6e2800000000000000000000000000006020808301919091527f75696e743235362073616c742c0000000000000000000000000000000000000060328301527f61646472657373207369676e6572416464726573732c00000000000000000000603f8301527f627974657320646174610000000000000000000000000000000000000000000060558301527f2900000000000000000000000000000000000000000000000000000000000000605f830152825180830384018152606090920192839052815160009384938493909282918401908083835b6020831061357c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161353f565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909216911617905260405191909301819003812089519097508995509093508392850191508083835b6020831061361257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016135d5565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040805192909401829003822097825281019a909a525073ffffffffffffffffffffffffffffffffffffffff97909716968801969096525050606085015250506080909120919050565b600280546040517f190100000000000000000000000000000000000000000000000000000000000081529182015260228101919091526042902090565b6000612fbe611afd83613e23565b60008183106136ee578161260a565b5090919050565b6136fd614386565b6020810182905260a08301516080840151613719918491613909565b808252608084015160c0850151613731929190613909565b604082015260a083015160e084015161374b918491613909565b606082015292915050565b60018054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156137ff5780601f106137d4576101008083540402835291602001916137ff565b820191906000526020600020905b8154815290600101906020018083116137e257829003601f168201915b5050505050905061381f8461014001518560000151858560000151613a23565b6138388461016001518486600001518560200151613a23565b61385081856000015186604001518560400151613a23565b6127a3818486604001518560600151613a23565b6000828201838110156138a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567d565b8091505b5092915050565b6000808315156138c157600091506138a7565b508282028284828115156138d157fe5b04146138a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061567d565b6000808311613944576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b61394f84848461427c565b15613438576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156ad565b60008083116139c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b6139cc848484614301565b15613a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156ad565b61344b613445613a1386856138ae565b613a1e866001612f7d565b613864565b600080600083118015613a6257508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b15613be5578551600310613aa2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061573d565b50506020848101517fffffffff00000000000000000000000000000000000000000000000000000000166000818152600b90925260409091205473ffffffffffffffffffffffffffffffffffffffff16801515613b2b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906156ed565b604051660fffffffffffe0603f885101168060840182017fa85e59e40000000000000000000000000000000000000000000000000000000083526080600484015273ffffffffffffffffffffffffffffffffffffffff8816602484015273ffffffffffffffffffffffffffffffffffffffff87166044840152856064840152608483015b81811015613bc757895181526020998a019901613baf565b61020084858403866000895af1801515613bdf573d85fd5b50505050505b505050505050565b805160009060ff16600314613c2e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061579d565b606083015173ffffffffffffffffffffffffffffffffffffffff1615613ca157606083015173ffffffffffffffffffffffffffffffffffffffff163314613ca1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c6906157ad565b613ca96125df565b835190915073ffffffffffffffffffffffffffffffffffffffff808316911614613cff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061566d565b505050565b6000818152600560205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558281015183516101408501516101608601519351859473ffffffffffffffffffffffffffffffffffffffff9485169493909316927fdc47b3613d9fe400085f6dbdc99453462279057e6207385042827ed6b1a62cf792613d9f923392906154b7565b60405180910390a45050565b600081601401835110151515613ded576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061578d565b50016014015173ffffffffffffffffffffffffffffffffffffffff1690565b6000808284811515613e1a57fe5b04949350505050565b604080517f4f726465722800000000000000000000000000000000000000000000000000006020808301919091527f61646472657373206d616b6572416464726573732c000000000000000000000060268301527f616464726573732074616b6572416464726573732c0000000000000000000000603b8301527f6164647265737320666565526563697069656e74416464726573732c0000000060508301527f616464726573732073656e646572416464726573732c00000000000000000000606c8301527f75696e74323536206d616b65724173736574416d6f756e742c0000000000000060828301527f75696e743235362074616b65724173736574416d6f756e742c00000000000000609b8301527f75696e74323536206d616b65724665652c00000000000000000000000000000060b48301527f75696e743235362074616b65724665652c00000000000000000000000000000060c58301527f75696e743235362065787069726174696f6e54696d655365636f6e64732c000060d68301527f75696e743235362073616c742c0000000000000000000000000000000000000060f48301527f6279746573206d616b65724173736574446174612c00000000000000000000006101018301527f62797465732074616b65724173736574446174610000000000000000000000006101168301527f290000000000000000000000000000000000000000000000000000000000000061012a830152825161010b81840301815261012b90920192839052815160009384938493849391929182918401908083835b602083106140ab57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161406e565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930181900381206101408b0151805191995095509093508392850191508083835b6020831061414657805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101614109565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930181900381206101608b0151805191985095509093508392850191508083835b602083106141e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016141a4565b5181516020939093036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909116921691909117905260405192018290039091207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0890180516101408b018051610160909c0180519a84529881529288526101a0822091529890525050509190525090919050565b6000808084116142b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b8215806142c3575084155b156142d15760009150610a88565b838015156142db57fe5b85840990506142ea85846138ae565b6142f66103e8836138ae565b101595945050505050565b60008080841161433d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c69061564d565b821580614348575084155b156143565760009150610a88565b8380151561436057fe5b8584099050836143708583612f7d565b81151561437957fe5b0690506142ea85846138ae565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b610120604051908101604052806143c4614386565b81526020016143d1614386565b8152602001600081525090565b604080516060810182526000808252602082018190529181019190915290565b600061260a82356158b0565b6000601f8201831361441b57600080fd5b813561442e6144298261583f565b615818565b81815260209384019390925082018360005b8381101561446c578135860161445688826145bc565b8452506020928301929190910190600101614440565b5050505092915050565b6000601f8201831361448757600080fd5b81356144956144298261583f565b81815260209384019390925082018360005b8381101561446c57813586016144bd888261460b565b84525060209283019291909101906001016144a7565b6000601f820183136144e457600080fd5b81356144f26144298261583f565b9150818183526020840193506020810190508385602084028201111561451757600080fd5b60005b8381101561446c578161452d888261454f565b845250602092830192919091019060010161451a565b600061260a82356158c9565b600061260a82356158ce565b600061260a82356158d1565b600061260a82516158d1565b600080601f8301841361458557600080fd5b50813567ffffffffffffffff81111561459d57600080fd5b6020830191508360018202830111156145b557600080fd5b9250929050565b6000601f820183136145cd57600080fd5b81356145db61442982615860565b915080825260208301602083018583830111156145f757600080fd5b614602838284615907565b50505092915050565b6000610180828403121561461e57600080fd5b614629610180615818565b9050600061463784846143fe565b8252506020614648848483016143fe565b602083015250604061465c848285016143fe565b6040830152506060614670848285016143fe565b60608301525060806146848482850161454f565b60808301525060a06146988482850161454f565b60a08301525060c06146ac8482850161454f565b60c08301525060e06146c08482850161454f565b60e0830152506101006146d58482850161454f565b610100830152506101206146eb8482850161454f565b6101208301525061014082013567ffffffffffffffff81111561470d57600080fd5b614719848285016145bc565b6101408301525061016082013567ffffffffffffffff81111561473b57600080fd5b614747848285016145bc565b6101608301525092915050565b60006020828403121561476657600080fd5b600061344b84846143fe565b6000806040838503121561478557600080fd5b600061479185856143fe565b92505060206147a2858286016143fe565b9150509250929050565b600080604083850312156147bf57600080fd5b60006147cb85856143fe565b92505060206147a285828601614543565b6000602082840312156147ee57600080fd5b813567ffffffffffffffff81111561480557600080fd5b61344b84828501614476565b60008060006060848603121561482657600080fd5b833567ffffffffffffffff81111561483d57600080fd5b61484986828701614476565b935050602084013567ffffffffffffffff81111561486657600080fd5b614872868287016144d3565b925050604084013567ffffffffffffffff81111561488f57600080fd5b61489b8682870161440a565b9150509250925092565b6000806000606084860312156148ba57600080fd5b833567ffffffffffffffff8111156148d157600080fd5b6148dd86828701614476565b93505060206148728682870161454f565b60006020828403121561490057600080fd5b600061344b848461454f565b6000806040838503121561491f57600080fd5b6000614791858561454f565b6000806000806060858703121561494157600080fd5b600061494d878761454f565b945050602061495e878288016143fe565b935050604085013567ffffffffffffffff81111561497b57600080fd5b61498787828801614573565b95989497509550505050565b6000806000606084860312156149a857600080fd5b60006149b4868661454f565b93505060206149c5868287016143fe565b925050604084013567ffffffffffffffff8111156149e257600080fd5b61489b868287016145bc565b600060208284031215614a0057600080fd5b600061344b848461455b565b600060208284031215614a1e57600080fd5b600061344b8484614567565b600060208284031215614a3c57600080fd5b813567ffffffffffffffff811115614a5357600080fd5b61344b8482850161460b565b60008060008060808587031215614a7557600080fd5b843567ffffffffffffffff811115614a8c57600080fd5b614a988782880161460b565b945050602085013567ffffffffffffffff811115614ab557600080fd5b614ac18782880161460b565b935050604085013567ffffffffffffffff811115614ade57600080fd5b614aea878288016145bc565b925050606085013567ffffffffffffffff811115614b0757600080fd5b614b13878288016145bc565b91505092959194509250565b600080600060608486031215614b3457600080fd5b833567ffffffffffffffff811115614b4b57600080fd5b614b578682870161460b565b93505060206149c58682870161454f565b60008060008060008060808789031215614b8157600080fd5b6000614b8d898961454f565b9650506020614b9e89828a016143fe565b955050604087013567ffffffffffffffff811115614bbb57600080fd5b614bc789828a01614573565b9450945050606087013567ffffffffffffffff811115614be657600080fd5b614bf289828a01614573565b92509250509295509295509295565b614c0a816158b0565b82525050565b6000614c1b826158ac565b808452602084019350614c2d836158a6565b60005b82811015614c5d57614c438683516153e5565b614c4c826158a6565b606096909601959150600101614c30565b5093949350505050565b614c0a816158c9565b614c0a816158ce565b614c0a816158d1565b6000614c8d826158ac565b808452614ca1816020860160208601615913565b614caa8161593f565b9093016020019392505050565b614c0a816158fc565b601281527f4c454e4754485f36355f52455155495245440000000000000000000000000000602082015260400190565b600d81527f494e56414c49445f54414b455200000000000000000000000000000000000000602082015260400190565b600e81527f4f524445525f4f56455246494c4c000000000000000000000000000000000000602082015260400190565b601181527f55494e543235365f554e444552464c4f57000000000000000000000000000000602082015260400190565b601a81527f41535345545f50524f58595f414c52454144595f455849535453000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f33325f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601581527f5349474e41545552455f554e535550504f525445440000000000000000000000602082015260400190565b601081527f4449564953494f4e5f42595f5a45524f00000000000000000000000000000000602082015260400190565b601781527f494e56414c49445f4f524445525f5349474e4154555245000000000000000000602082015260400190565b600d81527f494e56414c49445f4d414b455200000000000000000000000000000000000000602082015260400190565b601081527f55494e543235365f4f564552464c4f5700000000000000000000000000000000602082015260400190565b600f81527f494e56414c49445f54585f484153480000000000000000000000000000000000602082015260400190565b601181527f494e56414c49445f5349474e4154555245000000000000000000000000000000602082015260400190565b600e81527f524f554e44494e475f4552524f52000000000000000000000000000000000000602082015260400190565b601081527f4641494c45445f455845435554494f4e00000000000000000000000000000000602082015260400190565b600d81527f54414b45525f4f56455250415900000000000000000000000000000000000000602082015260400190565b601481527f494e56414c49445f54414b45525f414d4f554e54000000000000000000000000602082015260400190565b601a81527f41535345545f50524f58595f444f45535f4e4f545f4558495354000000000000602082015260400190565b602181527f475245415445525f5448414e5f5a45524f5f4c454e4754485f5245515549524560208201527f4400000000000000000000000000000000000000000000000000000000000000604082015260600190565b601181527f5349474e41545552455f494c4c4547414c000000000000000000000000000000602082015260400190565b601e81527f4c454e4754485f475245415445525f5448414e5f305f52455155495245440000602082015260400190565b601781527f494e56414c49445f4e45575f4f524445525f45504f4348000000000000000000602082015260400190565b601e81527f4c454e4754485f475245415445525f5448414e5f335f52455155495245440000602082015260400190565b601481527f434f4d504c4554455f46494c4c5f4641494c4544000000000000000000000000602082015260400190565b601281527f494e56414c49445f46494c4c5f50524943450000000000000000000000000000602082015260400190565b601281527f5245454e5452414e43595f494c4c4547414c0000000000000000000000000000602082015260400190565b601381527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000602082015260400190565b602681527f475245415445525f4f525f455155414c5f544f5f32305f4c454e4754485f524560208201527f5155495245440000000000000000000000000000000000000000000000000000604082015260600190565b601081527f4f524445525f554e46494c4c41424c4500000000000000000000000000000000602082015260400190565b600e81527f494e56414c49445f53454e444552000000000000000000000000000000000000602082015260400190565b601881527f4e454741544956455f5350524541445f52455155495245440000000000000000602082015260400190565b601481527f494e56414c49445f54585f5349474e4154555245000000000000000000000000602082015260400190565b601181527f4c454e4754485f305f5245515549524544000000000000000000000000000000602082015260400190565b805160808301906153738482614c70565b5060208201516153866020850182614c70565b5060408201516153996040850182614c70565b5060608201516127a36060850182614c70565b80516101208301906153be8482615362565b5060208201516153d16080850182615362565b5060408201516127a3610100850182614c70565b805160608301906153f6848261541c565b5060208201516154096020850182614c70565b5060408201516127a36040850182614c70565b614c0a816158f6565b60208101612fbe8284614c01565b6101008101615442828b614c01565b61544f602083018a614c01565b61545c6040830189614c70565b6154696060830188614c70565b6154766080830187614c70565b61548360a0830186614c70565b81810360c08301526154958185614c82565b905081810360e08301526154a98184614c82565b9a9950505050505050505050565b606081016154c58286614c01565b81810360208301526154d78185614c82565b905081810360408301526154eb8184614c82565b95945050505050565b6020808252810161260a8184614c10565b60208101612fbe8284614c67565b60208101612fbe8284614c70565b6060810161552f8286614c70565b61553c6020830185614c01565b81810360408301526154eb8184614c82565b6040810161555c8285614c70565b818103602083015261344b8184614c82565b6080810161557c8287614c70565b615589602083018661541c565b6155966040830185614c70565b6154eb6060830184614c70565b604081016155b18285614c79565b61260a6020830184614c01565b6020808252810161260a8184614c82565b60208101612fbe8284614cb7565b60208082528101612fbe81614cc0565b60208082528101612fbe81614cf0565b60208082528101612fbe81614d20565b60208082528101612fbe81614d50565b60208082528101612fbe81614d80565b60208082528101612fbe81614db0565b60208082528101612fbe81614e06565b60208082528101612fbe81614e36565b60208082528101612fbe81614e66565b60208082528101612fbe81614e96565b60208082528101612fbe81614ec6565b60208082528101612fbe81614ef6565b60208082528101612fbe81614f26565b60208082528101612fbe81614f56565b60208082528101612fbe81614f86565b60208082528101612fbe81614fb6565b60208082528101612fbe81614fe6565b60208082528101612fbe81615016565b60208082528101612fbe81615046565b60208082528101612fbe8161509c565b60208082528101612fbe816150cc565b60208082528101612fbe816150fc565b60208082528101612fbe8161512c565b60208082528101612fbe8161515c565b60208082528101612fbe8161518c565b60208082528101612fbe816151bc565b60208082528101612fbe816151ec565b60208082528101612fbe8161521c565b60208082528101612fbe81615272565b60208082528101612fbe816152a2565b60208082528101612fbe816152d2565b60208082528101612fbe81615302565b60208082528101612fbe81615332565b60808101612fbe8284615362565b6101208101612fbe82846153ac565b60608101612fbe82846153e5565b60405181810167ffffffffffffffff8111828210171561583757600080fd5b604052919050565b600067ffffffffffffffff82111561585657600080fd5b5060209081020190565b600067ffffffffffffffff82111561587757600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b151590565b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b60ff1690565b6000612fbe826158b0565b82818337506000910152565b60005b8381101561592e578181015183820152602001615916565b838111156127a35750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016905600a265627a7a72305820d41ee66f45c4d1637cb6e5f109447c6d5d7fef3204a685dc442151c0f029b7da6c6578706572696d656e74616cf50037" + } + } + }, + "networks": {} +} diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/Forwarder.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/Forwarder.json new file mode 100644 index 0000000000..a7bd62f8ec --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/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/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/IValidator.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/IValidator.json new file mode 100644 index 0000000000..8ca99f261a --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/IValidator.json @@ -0,0 +1,41 @@ +{ + "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": { + "object": "0x" + } + } + }, + "networks": {} +} diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/IWallet.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/IWallet.json new file mode 100644 index 0000000000..2a8f975cc1 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/IWallet.json @@ -0,0 +1,37 @@ +{ + "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": { + "object": "0x" + } + } + }, + "networks": {} +} diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/OrderValidator.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/OrderValidator.json new file mode 100644 index 0000000000..90a92e7cb8 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/OrderValidator.json @@ -0,0 +1,572 @@ +{ + "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" + } + } + }, + "networks": {} +} diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/WETH9.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/WETH9.json new file mode 100644 index 0000000000..e6ce25f7d2 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/WETH9.json @@ -0,0 +1,293 @@ +{ + "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" + } + } + }, + "networks": {} +} diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ZRXToken.json b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ZRXToken.json new file mode 100644 index 0000000000..29bb558244 --- /dev/null +++ b/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ZRXToken.json @@ -0,0 +1,227 @@ +{ + "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" + } + ], + "evm": { + "bytecode": { + "linkReferences": {}, + "object": + "0x60606040526b033b2e3c9fd0803ce8000000600355341561001c57fe5b5b600354600160a060020a0333166000908152602081905260409020555b5b61078d8061004a6000396000f300606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a723058201b5b70cf82a73dec658c2e60ab9a0f8e2ba01a74b66a6f5b0402f56d2ea0ffcf0029" + } + } + }, + "networks": {} +} From d1a82cd1320f6834b8e36cffaada331658d0d4f7 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Fri, 4 Jan 2019 08:07:25 -0500 Subject: [PATCH 06/17] Move contract addresses to their own package --- .circleci/config.yml | 25 +++ README.md | 9 +- .../contract_addresses/.discharge.json | 13 ++ python-packages/contract_addresses/README.md | 45 +++++ python-packages/contract_addresses/setup.py | 179 ++++++++++++++++++ .../contract_addresses/src/conf.py | 54 ++++++ .../src/doc_static/.gitkeep | 0 .../contract_addresses/src/index.rst | 25 +++ .../src/zero_ex/__init__.py | 2 + .../zero_ex/contract_addresses/__init__.py | 93 +++++++++ .../src/zero_ex/contract_addresses/py.typed | 0 .../stubs/distutils/__init__.pyi | 0 .../stubs/distutils/command/__init__.pyi | 0 .../stubs/distutils/command/clean.pyi | 7 + .../stubs/setuptools/__init__.pyi | 8 + .../stubs/setuptools/command/__init__.pyi | 0 .../stubs/setuptools/command/test.pyi | 3 + python-packages/contract_addresses/tox.ini | 12 ++ python-packages/contract_demo/setup.py | 1 + .../contract_demo/test/test_exchange.py | 9 +- python-packages/order_utils/setup.py | 1 + .../src/zero_ex/order_utils/__init__.py | 13 +- 22 files changed, 483 insertions(+), 16 deletions(-) create mode 100644 python-packages/contract_addresses/.discharge.json create mode 100644 python-packages/contract_addresses/README.md create mode 100755 python-packages/contract_addresses/setup.py create mode 100644 python-packages/contract_addresses/src/conf.py create mode 100644 python-packages/contract_addresses/src/doc_static/.gitkeep create mode 100644 python-packages/contract_addresses/src/index.rst create mode 100644 python-packages/contract_addresses/src/zero_ex/__init__.py create mode 100644 python-packages/contract_addresses/src/zero_ex/contract_addresses/__init__.py create mode 100644 python-packages/contract_addresses/src/zero_ex/contract_addresses/py.typed create mode 100644 python-packages/contract_addresses/stubs/distutils/__init__.pyi create mode 100644 python-packages/contract_addresses/stubs/distutils/command/__init__.pyi create mode 100644 python-packages/contract_addresses/stubs/distutils/command/clean.pyi create mode 100644 python-packages/contract_addresses/stubs/setuptools/__init__.pyi create mode 100644 python-packages/contract_addresses/stubs/setuptools/command/__init__.pyi create mode 100644 python-packages/contract_addresses/stubs/setuptools/command/test.pyi create mode 100644 python-packages/contract_addresses/tox.ini diff --git a/.circleci/config.yml b/.circleci/config.yml index 0d3176a2f7..7a4c2693d0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -200,6 +200,11 @@ jobs: - 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/contract_addresses + python -m ensurepip + python -m pip install . - run: command: | cd python-packages/order_utils @@ -219,6 +224,10 @@ jobs: - '.mypy_cache' - '.pytest_cache' - '.tox' + - run: + command: | + cd python-packages/contract_addresses + coverage run setup.py test - run: command: | cd python-packages/contract_demo @@ -231,6 +240,10 @@ jobs: command: | cd python-packages/sra_client coverage run setup.py test + - save_cache: + key: coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }} + paths: + - ~/repo/python-packages/contract_addresses/.coverage - save_cache: key: coverage-python-contract-demo-{{ .Environment.CIRCLE_SHA1 }} paths: @@ -281,6 +294,11 @@ jobs: - 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/contract_addresses + python -m ensurepip + python -m pip install .[dev] - run: command: | cd python-packages/contract_demo @@ -296,6 +314,10 @@ jobs: paths: - '/usr/local/bin' - '/usr/local/lib/python3.7/site-packages' + - run: + command: | + cd python-packages/contract_addresses + python setup.py lint - run: command: | cd python-packages/contract_demo @@ -372,6 +394,9 @@ jobs: - restore_cache: keys: - coverage-contracts-{{ .Environment.CIRCLE_SHA1 }} + - restore_cache: + keys: + - coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: keys: - coverage-python-contract-demo-{{ .Environment.CIRCLE_SHA1 }} diff --git a/README.md b/README.md index fd96c2b86b..078b01ea83 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,11 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr ### Python Packages -| Package | Version | Description | -| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| [`0x-order-utils`](/python-packages/order_utils) | [![PyPI](https://img.shields.io/pypi/v/0x-order-utils.svg)](https://pypi.org/project/0x-order-utils/) | A set of utilities for generating, parsing, signing and validating 0x orders | -| [`0x-sra-client`](/python-packages/sra_client) | [![PyPI](https://img.shields.io/pypi/v/0x-sra-client.svg)](https://pypi.org/project/0x-sra-client/) | A Python client for interacting with servers conforming to the Standard Relayer API specification | +| Package | Version | Description | +| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| [`0x-contract-addresses`](/python-packages/contract_addresses) | [![PyPI](https://img.shields.io/pypi/v/0x-contract-addresses.svg)](https://pypi.org/project/0x-contract-addresses/) | A tiny utility library for getting known deployed contract addresses for a particular network | +| [`0x-order-utils`](/python-packages/order_utils) | [![PyPI](https://img.shields.io/pypi/v/0x-order-utils.svg)](https://pypi.org/project/0x-order-utils/) | A set of utilities for generating, parsing, signing and validating 0x orders | +| [`0x-sra-client`](/python-packages/sra_client) | [![PyPI](https://img.shields.io/pypi/v/0x-sra-client.svg)](https://pypi.org/project/0x-sra-client/) | A Python client for interacting with servers conforming to the Standard Relayer API specification | ### Typescript/Javascript Packages diff --git a/python-packages/contract_addresses/.discharge.json b/python-packages/contract_addresses/.discharge.json new file mode 100644 index 0000000000..d6c90a20f0 --- /dev/null +++ b/python-packages/contract_addresses/.discharge.json @@ -0,0 +1,13 @@ +{ + "domain": "0x-contract-addresses-py", + "build_command": "python setup.py build_sphinx", + "upload_directory": "build/docs/html", + "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/python-packages/contract_addresses/README.md b/python-packages/contract_addresses/README.md new file mode 100644 index 0000000000..e2714afdfd --- /dev/null +++ b/python-packages/contract_addresses/README.md @@ -0,0 +1,45 @@ +## 0x-contract-addresses + +Addresses at which the 0x smart contracts have been deployed. + +Read the [documentation](http://0x-contract-addresses-py.s3-website-us-east-1.amazonaws.com/) + +## Installing + +```bash +pip install 0x-contract-addresses +``` + +## 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/contract_addresses/setup.py b/python-packages/contract_addresses/setup.py new file mode 100755 index 0000000000..83aca8172b --- /dev/null +++ b/python-packages/contract_addresses/setup.py @@ -0,0 +1,179 @@ +#!/usr/bin/env python + +"""setuptools module for contract_addresses package.""" + +import subprocess # nosec +from shutil import rmtree +from os import environ, path +from sys import argv + +from distutils.command.clean import clean +import distutils.command.build_py +from setuptools import find_packages, setup + + +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 = [ + # formatter: + "black --line-length 79 --check --diff src setup.py".split(), + # style guide checker (formerly pep8): + "pycodestyle --show-source --show-pep8 src setup.py".split(), + # docstring style checker: + "pydocstyle src setup.py".split(), + # static type checker: + "mypy src setup.py".split(), + # security issue checker: + "bandit -r src ./setup.py".split(), + # general linter: + "pylint src setup.py".split(), + # 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" + ) + + for lint_command in lint_commands: + print( + "Running lint command `", " ".join(lint_command).strip(), "`" + ) + subprocess.check_call(lint_command) # nosec + + +class CleanCommandExtension(clean): + """Custom command to do custom cleanup.""" + + def run(self): + """Run the regular clean, followed by our custom commands.""" + super().run() + rmtree("dist", ignore_errors=True) + rmtree(".mypy_cache", ignore_errors=True) + rmtree(".tox", ignore_errors=True) + rmtree(".pytest_cache", ignore_errors=True) + rmtree("src/0x_contract_addresses.egg-info", ignore_errors=True) + + +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() + ) + + +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 + + +class PublishDocsCommand(distutils.command.build_py.build_py): + """Custom command to publish docs to S3.""" + + description = ( + "Publish docs to " + + "http://0x-contract-addresses-py.s3-website-us-east-1.amazonaws.com/" + ) + + def run(self): + """Run npm package `discharge` to build & upload docs.""" + subprocess.check_call("discharge deploy".split()) # nosec + + +with open("README.md", "r") as file_handle: + README_MD = file_handle.read() + + +setup( + name="0x-contract-addresses", + version="2.0.0", + description="Addresses at which the 0x smart contracts have been deployed", + long_description=README_MD, + long_description_content_type="text/markdown", + url=( + "https://github.com/0xproject/0x-monorepo/tree/development" + + "/python-packages/contract_addresses" + ), + author="F. Eugene Aumson", + author_email="feuGeneA@users.noreply.github.com", + cmdclass={ + "clean": CleanCommandExtension, + "lint": LintCommand, + "test_publish": TestPublishCommand, + "publish": PublishCommand, + "publish_docs": PublishDocsCommand, + }, + install_requires=["mypy_extensions"], + extras_require={ + "dev": [ + "bandit", + "black", + "coverage", + "coveralls", + "mypy", + "mypy_extensions", + "pycodestyle", + "pydocstyle", + "pylint", + "pytest", + "sphinx", + "tox", + "twine", + ] + }, + python_requires=">=3.6, <4", + package_data={"zero_ex.contract_addresses": ["py.typed"]}, + package_dir={"": "src"}, + license="Apache 2.0", + keywords=( + "ethereum cryptocurrency 0x decentralized blockchain dex exchange" + ), + namespace_packages=["zero_ex"], + packages=find_packages("src"), + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Financial and Insurance Industry", + "License :: OSI Approved :: Apache Software License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python", + "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, # required per mypy + command_options={ + "build_sphinx": { + "source_dir": ("setup.py", "src"), + "build_dir": ("setup.py", "build/docs"), + } + }, +) diff --git a/python-packages/contract_addresses/src/conf.py b/python-packages/contract_addresses/src/conf.py new file mode 100644 index 0000000000..a0f372bc5f --- /dev/null +++ b/python-packages/contract_addresses/src/conf.py @@ -0,0 +1,54 @@ +"""Configuration file for the Sphinx documentation builder.""" + +# 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 = "0x-contract-addresses" +# pylint: disable=redefined-builtin +copyright = "2018, ZeroEx, Intl." +author = "F. Eugene Aumson" +version = pkg_resources.get_distribution("0x-contract-addresses").version +release = "" # The full version, including alpha/beta/rc tags + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.viewcode", +] + +templates_path = ["doc_templates"] + +source_suffix = ".rst" +# eg: source_suffix = [".rst", ".md"] + +master_doc = "index" # The master toctree document. + +language = None + +exclude_patterns: List[str] = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = None + +html_theme = "alabaster" + +html_static_path = ["doc_static"] +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". + +# Output file base name for HTML help builder. +htmlhelp_basename = "contract_addressespydoc" + +# -- Extension configuration: + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {"https://docs.python.org/": None} diff --git a/python-packages/contract_addresses/src/doc_static/.gitkeep b/python-packages/contract_addresses/src/doc_static/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_addresses/src/index.rst b/python-packages/contract_addresses/src/index.rst new file mode 100644 index 0000000000..7ac329ce2e --- /dev/null +++ b/python-packages/contract_addresses/src/index.rst @@ -0,0 +1,25 @@ +.. source for the sphinx-generated build/docs/web/index.html + +Python zero_ex.contract_addresses +================================= + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + +.. autoclass:: zero_ex.contract_addresses.NetworkId + + See source for enum members. + +.. autoclass:: zero_ex.contract_addresses.ContractAddresses + :members: + +.. autodata:: zero_ex.contract_addresses.NETWORK_TO_ADDRESSES + :annotation: + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/python-packages/contract_addresses/src/zero_ex/__init__.py b/python-packages/contract_addresses/src/zero_ex/__init__.py new file mode 100644 index 0000000000..e90d833db6 --- /dev/null +++ b/python-packages/contract_addresses/src/zero_ex/__init__.py @@ -0,0 +1,2 @@ +"""0x Python API.""" +__import__("pkg_resources").declare_namespace(__name__) diff --git a/python-packages/contract_addresses/src/zero_ex/contract_addresses/__init__.py b/python-packages/contract_addresses/src/zero_ex/contract_addresses/__init__.py new file mode 100644 index 0000000000..a4bfc3f4cc --- /dev/null +++ b/python-packages/contract_addresses/src/zero_ex/contract_addresses/__init__.py @@ -0,0 +1,93 @@ +"""Addresses at which the 0x smart contracts have been deployed.""" + +from enum import Enum +from typing import Dict, NamedTuple + + +class ContractAddresses(NamedTuple): # noqa + """An abstract record listing all the contracts that have addresses.""" + + erc20_proxy: str + erc721_proxy: str + zrx_token: str + ether_token: str + exchange: str + asset_proxy_owner: str + forwarder: str + order_validator: str + + +class NetworkId(Enum): + """Network names correlated to their network identification numbers. + + >>> NetworkId.MAINNET + + """ + + MAINNET = 1 + ROPSTEN = 3 + RINKEBY = 4 + KOVAN = 42 + GANACHE = 50 + + +NETWORK_TO_ADDRESSES: Dict[NetworkId, ContractAddresses] = { + NetworkId.MAINNET: ContractAddresses( + erc20_proxy="0x2240dab907db71e64d3e0dba4800c83b5c502d4e", + erc721_proxy="0x208e41fb445f1bb1b6780d58356e81405f3e6127", + zrx_token="0xe41d2489571d322189246dafa5ebde1f4699f498", + ether_token="0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + exchange="0x4f833a24e1f95d70f028921e27040ca56e09ab0b", + asset_proxy_owner="0x17992e4ffb22730138e4b62aaa6367fa9d3699a6", + forwarder="0x5468a1dc173652ee28d249c271fa9933144746b1", + order_validator="0x9463e518dea6810309563c81d5266c1b1d149138", + ), + NetworkId.ROPSTEN: ContractAddresses( + erc20_proxy="0xb1408f4c245a23c31b98d2c626777d4c0d766caa", + erc721_proxy="0xe654aac058bfbf9f83fcaee7793311dd82f6ddb4", + zrx_token="0xff67881f8d12f372d91baae9752eb3631ff0ed00", + ether_token="0xc778417e063141139fce010982780140aa0cd5ab", + exchange="0x4530c0483a1633c7a1c97d2c53721caff2caaaaf", + asset_proxy_owner="0xf5fa5b5fed2727a0e44ac67f6772e97977aa358b", + forwarder="0x2240dab907db71e64d3e0dba4800c83b5c502d4e", + order_validator="0x90431a90516ab49af23a0530e04e8c7836e7122f", + ), + NetworkId.RINKEBY: ContractAddresses( + exchange="0xbce0b5f6eb618c565c3e5f5cd69652bbc279f44e", + erc20_proxy="0x2f5ae4f6106e89b4147651688a92256885c5f410", + erc721_proxy="0x7656d773e11ff7383a14dcf09a9c50990481cd10", + zrx_token="0x8080c7e4b81ecf23aa6f877cfbfd9b0c228c6ffa", + ether_token="0xc778417e063141139fce010982780140aa0cd5ab", + asset_proxy_owner="0xe1703da878afcebff5b7624a826902af475b9c03", + forwarder="0x2d40589abbdee84961f3a7656b9af7adb0ee5ab4", + order_validator="0x0c5173a51e26b29d6126c686756fb9fbef71f762", + ), + NetworkId.KOVAN: ContractAddresses( + erc20_proxy="0xf1ec01d6236d3cd881a0bf0130ea25fe4234003e", + erc721_proxy="0x2a9127c745688a165106c11cd4d647d2220af821", + zrx_token="0x2002d3812f58e35f0ea1ffbf80a75a38c32175fa", + ether_token="0xd0a1e359811322d97991e03f863a0c30c2cf029c", + exchange="0x35dd2932454449b14cee11a94d3674a936d5d7b2", + asset_proxy_owner="0x2c824d2882baa668e0d5202b1e7f2922278703f8", + forwarder="0x17992e4ffb22730138e4b62aaa6367fa9d3699a6", + order_validator="0xb389da3d204b412df2f75c6afb3d0a7ce0bc283d", + ), + NetworkId.GANACHE: ContractAddresses( + exchange="0x48bacb9266a570d521063ef5dd96e61686dbe788", + erc20_proxy="0x1dc4c1cefef38a777b15aa20260a54e584b16c48", + erc721_proxy="0x1d7022f5b17d2f8b695918fb48fa1089c9f85401", + zrx_token="0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c", + ether_token="0x0b1ba0af832d7c05fd64161e0db78e85978e8082", + asset_proxy_owner="0x34d402f14d58e001d8efbe6585051bf9706aa064", + forwarder="0xb69e673309512a9d726f87304c6984054f87a93b", + order_validator="0xe86bb98fcf9bff3512c74589b78fb168200cc546", + ), +} +"""A mapping from instances of NetworkId to instances of ContractAddresses. + +Addresses under NetworkId.Ganache are from our Ganache snapshot generated from +migrations. + +>>> NETWORK_TO_ADDRESSES[NetworkId.MAINNET].exchange +0x4f833a24e1f95d70f028921e27040ca56e09ab0b +""" diff --git a/python-packages/contract_addresses/src/zero_ex/contract_addresses/py.typed b/python-packages/contract_addresses/src/zero_ex/contract_addresses/py.typed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_addresses/stubs/distutils/__init__.pyi b/python-packages/contract_addresses/stubs/distutils/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_addresses/stubs/distutils/command/__init__.pyi b/python-packages/contract_addresses/stubs/distutils/command/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_addresses/stubs/distutils/command/clean.pyi b/python-packages/contract_addresses/stubs/distutils/command/clean.pyi new file mode 100644 index 0000000000..46a42ddb13 --- /dev/null +++ b/python-packages/contract_addresses/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/contract_addresses/stubs/setuptools/__init__.pyi b/python-packages/contract_addresses/stubs/setuptools/__init__.pyi new file mode 100644 index 0000000000..8ea8d32b7e --- /dev/null +++ b/python-packages/contract_addresses/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/contract_addresses/stubs/setuptools/command/__init__.pyi b/python-packages/contract_addresses/stubs/setuptools/command/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_addresses/stubs/setuptools/command/test.pyi b/python-packages/contract_addresses/stubs/setuptools/command/test.pyi new file mode 100644 index 0000000000..c5ec770ad3 --- /dev/null +++ b/python-packages/contract_addresses/stubs/setuptools/command/test.pyi @@ -0,0 +1,3 @@ +from setuptools import Command + +class test(Command): ... diff --git a/python-packages/contract_addresses/tox.ini b/python-packages/contract_addresses/tox.ini new file mode 100644 index 0000000000..aa1037ed7c --- /dev/null +++ b/python-packages/contract_addresses/tox.ini @@ -0,0 +1,12 @@ +# tox (https://tox.readthedocs.io/) is a tool for running tests +# in multiple virtualenvs. This configuration file will run the +# test suite on all supported python versions. To use it, "pip install tox" +# and then run "tox" from this directory. + +[tox] +envlist = py37 + +[testenv] +commands = + pip install -e .[dev] + python setup.py lint diff --git a/python-packages/contract_demo/setup.py b/python-packages/contract_demo/setup.py index e04b5ab72d..fe6d5097e8 100755 --- a/python-packages/contract_demo/setup.py +++ b/python-packages/contract_demo/setup.py @@ -112,6 +112,7 @@ def run(self): "publish_docs": PublishDocsCommand, }, install_requires=[ + "0x-contract-addresses", "0x-order-utils", "0x-web3", # TEMPORARY! pending resolution of our web3.py PR#1147 "mypy_extensions", diff --git a/python-packages/contract_demo/test/test_exchange.py b/python-packages/contract_demo/test/test_exchange.py index 0ecd0e3b45..c9e9a59f1c 100644 --- a/python-packages/contract_demo/test/test_exchange.py +++ b/python-packages/contract_demo/test/test_exchange.py @@ -4,6 +4,7 @@ from web3 import Web3 from web3.utils import datatypes +from zero_ex.contract_addresses import NETWORK_TO_ADDRESSES, NetworkId from zero_ex.json_schemas import assert_valid from zero_ex.order_utils import ( _Constants, @@ -34,8 +35,9 @@ def test_get_order_info(): web3_instance = Web3(Web3.HTTPProvider("http://127.0.0.1:8545")) # false positive from pylint: disable=no-member - network_id = web3_instance.net.version - contract_address = _Constants.network_to_exchange_addr[network_id] + contract_address = NETWORK_TO_ADDRESSES[ + NetworkId(int(web3_instance.net.version)) + ].exchange assert_valid( order_to_jsdict(order, exchange_address=contract_address), @@ -55,7 +57,8 @@ def test_get_order_info(): assert isinstance(order_info.order_hash, bytes) assert order_info.order_hash.hex() == generate_order_hash_hex( - order, exchange_address=_Constants.network_to_exchange_addr["50"] + order, + exchange_address=NETWORK_TO_ADDRESSES[NetworkId.GANACHE].exchange, ) assert isinstance(order_info.order_taker_asset_filled_amount, int) diff --git a/python-packages/order_utils/setup.py b/python-packages/order_utils/setup.py index 5954339a8c..b070bb6249 100755 --- a/python-packages/order_utils/setup.py +++ b/python-packages/order_utils/setup.py @@ -189,6 +189,7 @@ def run(self): "ganache": GanacheCommand, }, install_requires=[ + "0x-contract-addresses", "eth-abi", "eth_utils", "hypothesis>=3.31.2", # HACK! this is web3's dependency! 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 38dd65d3e8..838b390139 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 @@ -24,6 +24,7 @@ from web3.providers.base import BaseProvider from web3.utils import datatypes +from zero_ex.contract_addresses import NETWORK_TO_ADDRESSES, NetworkId from zero_ex.dev_utils.type_assertions import ( assert_is_address, assert_is_hex_string, @@ -56,13 +57,6 @@ def contract_name_to_abi(cls, contract_name: str) -> Dict: )["compilerOutput"]["abi"] return cls._contract_name_to_abi[contract_name] - network_to_exchange_addr: Dict[str, str] = { - "1": "0x4f833a24e1f95d70f028921e27040ca56e09ab0b", - "3": "0x4530c0483a1633c7a1c97d2c53721caff2caaaaf", - "42": "0x35dd2932454449b14cee11a94d3674a936d5d7b2", - "50": "0x48bacb9266a570d521063ef5dd96e61686dbe788", - } - null_address = "0x0000000000000000000000000000000000000000" eip191_header = b"\x19\x01" @@ -358,8 +352,9 @@ def is_valid_signature( web3_instance = Web3(provider) # false positive from pylint: disable=no-member - network_id = web3_instance.net.version - contract_address = _Constants.network_to_exchange_addr[network_id] + contract_address = NETWORK_TO_ADDRESSES[ + NetworkId(int(web3_instance.net.version)) + ].exchange # false positive from pylint: disable=no-member contract: datatypes.Contract = web3_instance.eth.contract( address=to_checksum_address(contract_address), From 09e760d959a0620a59d1cac82248c60004935d57 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Fri, 4 Jan 2019 10:28:15 -0500 Subject: [PATCH 07/17] Move contract artifacts to their own package --- .circleci/config.yml | 25 +++ .prettierignore | 2 +- README.md | 1 + python-packages/contract_addresses/setup.py | 2 + .../contract_artifacts/.discharge.json | 13 ++ python-packages/contract_artifacts/.pylintrc | 3 + python-packages/contract_artifacts/README.md | 45 +++++ python-packages/contract_artifacts/setup.py | 188 ++++++++++++++++++ .../contract_artifacts/src/conf.py | 54 +++++ .../src/doc_static/.gitkeep | 0 .../contract_artifacts/src/index.rst | 18 ++ .../src/zero_ex/__init__.py | 2 + .../zero_ex/contract_artifacts/__init__.py | 35 ++++ .../artifacts/AssetProxyOwner.json | 0 .../artifacts/DummyERC20Token.json | 0 .../artifacts/DummyERC721Token.json | 0 .../artifacts/ERC20Proxy.json | 0 .../artifacts/ERC20Token.json | 0 .../artifacts/ERC721Proxy.json | 0 .../artifacts/ERC721Token.json | 0 .../artifacts/Exchange.json | 0 .../artifacts/Forwarder.json | 0 .../artifacts/IValidator.json | 0 .../contract_artifacts/artifacts/IWallet.json | 0 .../artifacts/OrderValidator.json | 0 .../contract_artifacts/artifacts/WETH9.json | 0 .../artifacts/ZRXToken.json | 0 .../src/zero_ex/contract_artifacts/py.typed | 0 .../stubs/distutils/__init__.pyi | 0 .../stubs/distutils/command/__init__.pyi | 0 .../stubs/distutils/command/clean.pyi | 7 + .../stubs/setuptools/__init__.pyi | 8 + .../stubs/setuptools/command/__init__.pyi | 0 .../stubs/setuptools/command/test.pyi | 3 + python-packages/contract_artifacts/tox.ini | 12 ++ python-packages/contract_demo/setup.py | 1 + .../contract_demo/test/test_exchange.py | 4 +- python-packages/order_utils/setup.py | 13 +- .../zero_ex/contract_artifacts/__init__.py | 1 - .../src/zero_ex/order_utils/__init__.py | 24 +-- .../order_utils/test/test_doctest.py | 18 -- 41 files changed, 424 insertions(+), 55 deletions(-) create mode 100644 python-packages/contract_artifacts/.discharge.json create mode 100644 python-packages/contract_artifacts/.pylintrc create mode 100644 python-packages/contract_artifacts/README.md create mode 100755 python-packages/contract_artifacts/setup.py create mode 100644 python-packages/contract_artifacts/src/conf.py create mode 100644 python-packages/contract_artifacts/src/doc_static/.gitkeep create mode 100644 python-packages/contract_artifacts/src/index.rst create mode 100644 python-packages/contract_artifacts/src/zero_ex/__init__.py create mode 100644 python-packages/contract_artifacts/src/zero_ex/contract_artifacts/__init__.py rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/AssetProxyOwner.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/DummyERC20Token.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/DummyERC721Token.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/ERC20Proxy.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/ERC20Token.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/ERC721Proxy.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/ERC721Token.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/Exchange.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/Forwarder.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/IValidator.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/IWallet.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/OrderValidator.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/WETH9.json (100%) rename python-packages/{order_utils => contract_artifacts}/src/zero_ex/contract_artifacts/artifacts/ZRXToken.json (100%) create mode 100644 python-packages/contract_artifacts/src/zero_ex/contract_artifacts/py.typed create mode 100644 python-packages/contract_artifacts/stubs/distutils/__init__.pyi create mode 100644 python-packages/contract_artifacts/stubs/distutils/command/__init__.pyi create mode 100644 python-packages/contract_artifacts/stubs/distutils/command/clean.pyi create mode 100644 python-packages/contract_artifacts/stubs/setuptools/__init__.pyi create mode 100644 python-packages/contract_artifacts/stubs/setuptools/command/__init__.pyi create mode 100644 python-packages/contract_artifacts/stubs/setuptools/command/test.pyi create mode 100644 python-packages/contract_artifacts/tox.ini delete mode 100644 python-packages/order_utils/src/zero_ex/contract_artifacts/__init__.py delete mode 100644 python-packages/order_utils/test/test_doctest.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 7a4c2693d0..2763423ba8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -205,6 +205,11 @@ jobs: cd python-packages/contract_addresses python -m ensurepip python -m pip install . + - run: + command: | + cd python-packages/contract_artifacts + python -m ensurepip + python -m pip install . - run: command: | cd python-packages/order_utils @@ -228,6 +233,10 @@ jobs: command: | cd python-packages/contract_addresses coverage run setup.py test + - run: + command: | + cd python-packages/contract_artifacts + coverage run setup.py test - run: command: | cd python-packages/contract_demo @@ -244,6 +253,10 @@ jobs: key: coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }} paths: - ~/repo/python-packages/contract_addresses/.coverage + - save_cache: + key: coverage-python-contract-artifacts-{{ .Environment.CIRCLE_SHA1 }} + paths: + - ~/repo/python-packages/contract_artifacts/.coverage - save_cache: key: coverage-python-contract-demo-{{ .Environment.CIRCLE_SHA1 }} paths: @@ -299,6 +312,11 @@ jobs: cd python-packages/contract_addresses python -m ensurepip python -m pip install .[dev] + - run: + command: | + cd python-packages/contract_artifacts + python -m ensurepip + python -m pip install .[dev] - run: command: | cd python-packages/contract_demo @@ -318,6 +336,10 @@ jobs: command: | cd python-packages/contract_addresses python setup.py lint + - run: + command: | + cd python-packages/contract_artifacts + python setup.py lint - run: command: | cd python-packages/contract_demo @@ -397,6 +419,9 @@ jobs: - restore_cache: keys: - coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }} + - restore_cache: + keys: + - coverage-python-contract-artifacts-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: keys: - coverage-python-contract-demo-{{ .Environment.CIRCLE_SHA1 }} diff --git a/.prettierignore b/.prettierignore index 7f8662b0a2..a509c4f882 100644 --- a/.prettierignore +++ b/.prettierignore @@ -18,7 +18,7 @@ lib /contracts/extensions/generated-artifacts /packages/abi-gen-wrappers/src/generated-wrappers /packages/contract-artifacts/artifacts -/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts +/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts /packages/json-schemas/schemas /python-packages/order_utils/src/zero_ex/json_schemas/schemas /packages/metacoin/src/contract_wrappers diff --git a/README.md b/README.md index 078b01ea83..5f9526794c 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr | Package | Version | Description | | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | [`0x-contract-addresses`](/python-packages/contract_addresses) | [![PyPI](https://img.shields.io/pypi/v/0x-contract-addresses.svg)](https://pypi.org/project/0x-contract-addresses/) | A tiny utility library for getting known deployed contract addresses for a particular network | +| [`0x-contract-artifacts`](/python-packages/contract_artifacts) | [![PyPI](https://img.shields.io/pypi/v/0x-contract-artifacts.svg)](https://pypi.org/project/0x-contract-artifacts/) | 0x smart contract compilation artifacts | | [`0x-order-utils`](/python-packages/order_utils) | [![PyPI](https://img.shields.io/pypi/v/0x-order-utils.svg)](https://pypi.org/project/0x-order-utils/) | A set of utilities for generating, parsing, signing and validating 0x orders | | [`0x-sra-client`](/python-packages/sra_client) | [![PyPI](https://img.shields.io/pypi/v/0x-sra-client.svg)](https://pypi.org/project/0x-sra-client/) | A Python client for interacting with servers conforming to the Standard Relayer API specification | diff --git a/python-packages/contract_addresses/setup.py b/python-packages/contract_addresses/setup.py index 83aca8172b..9ddafbeead 100755 --- a/python-packages/contract_addresses/setup.py +++ b/python-packages/contract_addresses/setup.py @@ -30,6 +30,8 @@ def run(self): "mypy src setup.py".split(), # security issue checker: "bandit -r src ./setup.py".split(), + # run doctests: + "pytest --doctest-modules".split(), # general linter: "pylint src setup.py".split(), # pylint takes relatively long to run, so it runs last, to enable diff --git a/python-packages/contract_artifacts/.discharge.json b/python-packages/contract_artifacts/.discharge.json new file mode 100644 index 0000000000..d9cb2a37b2 --- /dev/null +++ b/python-packages/contract_artifacts/.discharge.json @@ -0,0 +1,13 @@ +{ + "domain": "0x-contract-artifacts-py", + "build_command": "python setup.py build_sphinx", + "upload_directory": "build/docs/html", + "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/python-packages/contract_artifacts/.pylintrc b/python-packages/contract_artifacts/.pylintrc new file mode 100644 index 0000000000..937bc6313b --- /dev/null +++ b/python-packages/contract_artifacts/.pylintrc @@ -0,0 +1,3 @@ +[MESSAGES CONTROL] +disable=C0330,line-too-long,fixme,too-few-public-methods,too-many-ancestors +# C0330 is "bad hanging indent". we use indents per `black`. diff --git a/python-packages/contract_artifacts/README.md b/python-packages/contract_artifacts/README.md new file mode 100644 index 0000000000..e0a34cbca4 --- /dev/null +++ b/python-packages/contract_artifacts/README.md @@ -0,0 +1,45 @@ +## 0x-contract-artifacts + +0x smart contract compilation artifacts + +Read the [documentation](http://0x-contract-artifacts-py.s3-website-us-east-1.amazonaws.com/) + +## Installing + +```bash +pip install 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 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/contract_artifacts/setup.py b/python-packages/contract_artifacts/setup.py new file mode 100755 index 0000000000..7d738e48f0 --- /dev/null +++ b/python-packages/contract_artifacts/setup.py @@ -0,0 +1,188 @@ +#!/usr/bin/env python + +"""setuptools module for contract_artifacts package.""" + +import subprocess # nosec +from shutil import rmtree +from os import environ, path +from sys import argv + +from distutils.command.clean import clean +import distutils.command.build_py +from setuptools import find_packages, setup + + +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 = [ + # formatter: + "black --line-length 79 --check --diff src setup.py".split(), + # style guide checker (formerly pep8): + "pycodestyle --show-source --show-pep8 src setup.py".split(), + # docstring style checker: + "pydocstyle src setup.py".split(), + # static type checker: + "mypy src setup.py".split(), + # security issue checker: + "bandit -r src ./setup.py".split(), + # ensure contract artifacts match the authoritative copies: + # this is a hack. ideally we would symlink to the authoritative + # copies, but a problem with setuptools is preventing it from + # following symlinks when gathering package_data. see + # https://github.com/pypa/setuptools/issues/415. + ( + "diff src/zero_ex/contract_artifacts/artifacts" + + " ../../packages/contract-artifacts/artifacts" + ).split(), + # general linter: + "pylint src setup.py".split(), + # 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" + ) + + for lint_command in lint_commands: + print( + "Running lint command `", " ".join(lint_command).strip(), "`" + ) + subprocess.check_call(lint_command) # nosec + + +class CleanCommandExtension(clean): + """Custom command to do custom cleanup.""" + + def run(self): + """Run the regular clean, followed by our custom commands.""" + super().run() + rmtree("dist", ignore_errors=True) + rmtree(".mypy_cache", ignore_errors=True) + rmtree(".tox", ignore_errors=True) + rmtree(".pytest_cache", ignore_errors=True) + rmtree("src/0x_contract_artifacts.egg-info", ignore_errors=True) + + +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() + ) + + +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 + + +class PublishDocsCommand(distutils.command.build_py.build_py): + """Custom command to publish docs to S3.""" + + description = ( + "Publish docs to " + + "http://0x-contract-artifacts-py.s3-website-us-east-1.amazonaws.com/" + ) + + def run(self): + """Run npm package `discharge` to build & upload docs.""" + subprocess.check_call("discharge deploy".split()) # nosec + + +with open("README.md", "r") as file_handle: + README_MD = file_handle.read() + + +setup( + name="0x-contract-artifacts", + version="2.0.0", + description="0x smart contract compilation artifacts", + long_description=README_MD, + long_description_content_type="text/markdown", + url=( + "https://github.com/0xproject/0x-monorepo/tree/development" + + "/python-packages/contract_artifacts" + ), + author="F. Eugene Aumson", + author_email="feuGeneA@users.noreply.github.com", + cmdclass={ + "clean": CleanCommandExtension, + "lint": LintCommand, + "test_publish": TestPublishCommand, + "publish": PublishCommand, + "publish_docs": PublishDocsCommand, + }, + install_requires=["mypy_extensions"], + extras_require={ + "dev": [ + "bandit", + "black", + "coverage", + "coveralls", + "mypy", + "mypy_extensions", + "pycodestyle", + "pydocstyle", + "pylint", + "pytest", + "sphinx", + "tox", + "twine", + ] + }, + python_requires=">=3.6, <4", + package_data={"zero_ex.contract_artifacts": ["py.typed", "artifacts/*"]}, + package_dir={"": "src"}, + license="Apache 2.0", + keywords=( + "ethereum cryptocurrency 0x decentralized blockchain dex exchange" + ), + namespace_packages=["zero_ex"], + packages=find_packages("src"), + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Financial and Insurance Industry", + "License :: OSI Approved :: Apache Software License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python", + "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, # required per mypy + command_options={ + "build_sphinx": { + "source_dir": ("setup.py", "src"), + "build_dir": ("setup.py", "build/docs"), + } + }, +) diff --git a/python-packages/contract_artifacts/src/conf.py b/python-packages/contract_artifacts/src/conf.py new file mode 100644 index 0000000000..2b0a971168 --- /dev/null +++ b/python-packages/contract_artifacts/src/conf.py @@ -0,0 +1,54 @@ +"""Configuration file for the Sphinx documentation builder.""" + +# 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 = "0x-contract-artifacts" +# pylint: disable=redefined-builtin +copyright = "2018, ZeroEx, Intl." +author = "F. Eugene Aumson" +version = pkg_resources.get_distribution("0x-contract-artifacts").version +release = "" # The full version, including alpha/beta/rc tags + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.viewcode", +] + +templates_path = ["doc_templates"] + +source_suffix = ".rst" +# eg: source_suffix = [".rst", ".md"] + +master_doc = "index" # The master toctree document. + +language = None + +exclude_patterns: List[str] = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = None + +html_theme = "alabaster" + +html_static_path = ["doc_static"] +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". + +# Output file base name for HTML help builder. +htmlhelp_basename = "contract_artifactspydoc" + +# -- Extension configuration: + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {"https://docs.python.org/": None} diff --git a/python-packages/contract_artifacts/src/doc_static/.gitkeep b/python-packages/contract_artifacts/src/doc_static/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_artifacts/src/index.rst b/python-packages/contract_artifacts/src/index.rst new file mode 100644 index 0000000000..d086ad2880 --- /dev/null +++ b/python-packages/contract_artifacts/src/index.rst @@ -0,0 +1,18 @@ +.. source for the sphinx-generated build/docs/web/index.html + +Python zero_ex.contract_artifacts +================================= + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + +.. automodule:: zero_ex.contract_artifacts + :members: + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/python-packages/contract_artifacts/src/zero_ex/__init__.py b/python-packages/contract_artifacts/src/zero_ex/__init__.py new file mode 100644 index 0000000000..e90d833db6 --- /dev/null +++ b/python-packages/contract_artifacts/src/zero_ex/__init__.py @@ -0,0 +1,2 @@ +"""0x Python API.""" +__import__("pkg_resources").declare_namespace(__name__) diff --git a/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/__init__.py b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/__init__.py new file mode 100644 index 0000000000..18947ee3bc --- /dev/null +++ b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/__init__.py @@ -0,0 +1,35 @@ +"""0x smart contract compilation artifacts.""" + +import json +from typing import Dict +from pkg_resources import resource_string + + +class _ArtifactCache: + """A cache to facilitate lazy & singular loading of contract artifacts.""" + + _contract_name_to_abi: Dict[str, Dict] = {} # class data, not instance + + @classmethod + def contract_name_to_abi(cls, contract_name: str) -> Dict: + """Return the ABI for the given contract name. + + First tries to get data from the class level storage + `_contract_name_to_abi`. If it's not there, loads it from disk, stores + it in the class data (for the next caller), and then returns it. + """ + try: + return cls._contract_name_to_abi[contract_name] + except KeyError: + cls._contract_name_to_abi[contract_name] = json.loads( + resource_string( + "zero_ex.contract_artifacts", + f"artifacts/{contract_name}.json", + ) + )["compilerOutput"]["abi"] + return cls._contract_name_to_abi[contract_name] + + +def abi_by_name(contract_name: str) -> Dict: + """Return the ABI for the named contract.""" + return _ArtifactCache.contract_name_to_abi(contract_name) diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/AssetProxyOwner.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/AssetProxyOwner.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/AssetProxyOwner.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/AssetProxyOwner.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/DummyERC20Token.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/DummyERC20Token.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/DummyERC20Token.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/DummyERC20Token.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/DummyERC721Token.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/DummyERC721Token.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/DummyERC721Token.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/DummyERC721Token.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC20Proxy.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/ERC20Proxy.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC20Proxy.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/ERC20Proxy.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC20Token.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/ERC20Token.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC20Token.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/ERC20Token.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC721Proxy.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/ERC721Proxy.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC721Proxy.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/ERC721Proxy.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC721Token.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/ERC721Token.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ERC721Token.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/ERC721Token.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/Exchange.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/Exchange.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/Exchange.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/Exchange.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/Forwarder.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/Forwarder.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/Forwarder.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/Forwarder.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/IValidator.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/IValidator.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/IValidator.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/IValidator.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/IWallet.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/IWallet.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/IWallet.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/IWallet.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/OrderValidator.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/OrderValidator.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/OrderValidator.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/OrderValidator.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/WETH9.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/WETH9.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/WETH9.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/WETH9.json diff --git a/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ZRXToken.json b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/ZRXToken.json similarity index 100% rename from python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts/ZRXToken.json rename to python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/ZRXToken.json diff --git a/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/py.typed b/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/py.typed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_artifacts/stubs/distutils/__init__.pyi b/python-packages/contract_artifacts/stubs/distutils/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_artifacts/stubs/distutils/command/__init__.pyi b/python-packages/contract_artifacts/stubs/distutils/command/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_artifacts/stubs/distutils/command/clean.pyi b/python-packages/contract_artifacts/stubs/distutils/command/clean.pyi new file mode 100644 index 0000000000..46a42ddb13 --- /dev/null +++ b/python-packages/contract_artifacts/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/contract_artifacts/stubs/setuptools/__init__.pyi b/python-packages/contract_artifacts/stubs/setuptools/__init__.pyi new file mode 100644 index 0000000000..8ea8d32b7e --- /dev/null +++ b/python-packages/contract_artifacts/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/contract_artifacts/stubs/setuptools/command/__init__.pyi b/python-packages/contract_artifacts/stubs/setuptools/command/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/python-packages/contract_artifacts/stubs/setuptools/command/test.pyi b/python-packages/contract_artifacts/stubs/setuptools/command/test.pyi new file mode 100644 index 0000000000..c5ec770ad3 --- /dev/null +++ b/python-packages/contract_artifacts/stubs/setuptools/command/test.pyi @@ -0,0 +1,3 @@ +from setuptools import Command + +class test(Command): ... diff --git a/python-packages/contract_artifacts/tox.ini b/python-packages/contract_artifacts/tox.ini new file mode 100644 index 0000000000..aa1037ed7c --- /dev/null +++ b/python-packages/contract_artifacts/tox.ini @@ -0,0 +1,12 @@ +# tox (https://tox.readthedocs.io/) is a tool for running tests +# in multiple virtualenvs. This configuration file will run the +# test suite on all supported python versions. To use it, "pip install tox" +# and then run "tox" from this directory. + +[tox] +envlist = py37 + +[testenv] +commands = + pip install -e .[dev] + python setup.py lint diff --git a/python-packages/contract_demo/setup.py b/python-packages/contract_demo/setup.py index fe6d5097e8..a7afbd30c8 100755 --- a/python-packages/contract_demo/setup.py +++ b/python-packages/contract_demo/setup.py @@ -113,6 +113,7 @@ def run(self): }, install_requires=[ "0x-contract-addresses", + "0x-contract-artifacts", "0x-order-utils", "0x-web3", # TEMPORARY! pending resolution of our web3.py PR#1147 "mypy_extensions", diff --git a/python-packages/contract_demo/test/test_exchange.py b/python-packages/contract_demo/test/test_exchange.py index c9e9a59f1c..07492a4030 100644 --- a/python-packages/contract_demo/test/test_exchange.py +++ b/python-packages/contract_demo/test/test_exchange.py @@ -5,9 +5,9 @@ from web3.utils import datatypes from zero_ex.contract_addresses import NETWORK_TO_ADDRESSES, NetworkId +import zero_ex.contract_artifacts from zero_ex.json_schemas import assert_valid from zero_ex.order_utils import ( - _Constants, Order, OrderInfo, order_to_jsdict, @@ -47,7 +47,7 @@ def test_get_order_info(): # false positive from pylint: disable=no-member exchange: datatypes.Contract = web3_instance.eth.contract( address=to_checksum_address(contract_address), - abi=_Constants.contract_name_to_abi("Exchange"), + abi=zero_ex.contract_artifacts.abi_by_name("Exchange"), ) order_info = OrderInfo(*exchange.call().getOrderInfo(order)) diff --git a/python-packages/order_utils/setup.py b/python-packages/order_utils/setup.py index b070bb6249..5ee034a466 100755 --- a/python-packages/order_utils/setup.py +++ b/python-packages/order_utils/setup.py @@ -21,7 +21,7 @@ def run_tests(self): """Invoke pytest.""" import pytest - exit(pytest.main()) + exit(pytest.main(["--doctest-modules"])) class LintCommand(distutils.command.build_py.build_py): @@ -51,15 +51,6 @@ def run(self): "diff src/zero_ex/json_schemas/schemas" + " ../../packages/json-schemas/schemas" ).split(), - # ensure contract artifacts match the authoritative copies: - # this is a hack. ideally we would symlink to the authoritative - # copies, but a problem with setuptools is preventing it from - # following symlinks when gathering package_data. see - # https://github.com/pypa/setuptools/issues/415. - ( - "diff src/zero_ex/contract_artifacts/artifacts" - + " ../../packages/contract-artifacts/artifacts" - ).split(), # general linter: "pylint src test setup.py".split(), # pylint takes relatively long to run, so it runs last, to enable @@ -190,6 +181,7 @@ def run(self): }, install_requires=[ "0x-contract-addresses", + "0x-contract-artifacts", "eth-abi", "eth_utils", "hypothesis>=3.31.2", # HACK! this is web3's dependency! @@ -218,7 +210,6 @@ def run(self): python_requires=">=3.6, <4", package_data={ "zero_ex.order_utils": ["py.typed"], - "zero_ex.contract_artifacts": ["artifacts/*"], "zero_ex.json_schemas": ["py.typed", "schemas/*"], }, package_dir={"": "src"}, 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 deleted file mode 100644 index ed45d2c8eb..0000000000 --- a/python-packages/order_utils/src/zero_ex/contract_artifacts/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Solc-generated artifacts for 0x smart contracts.""" 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 838b390139..867f59d719 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 @@ -25,6 +25,7 @@ from web3.utils import datatypes from zero_ex.contract_addresses import NETWORK_TO_ADDRESSES, NetworkId +import zero_ex.contract_artifacts from zero_ex.dev_utils.type_assertions import ( assert_is_address, assert_is_hex_string, @@ -36,27 +37,6 @@ class _Constants: """Static data used by order utilities.""" - _contract_name_to_abi: Dict[str, Dict] = {} # class data, not instance - - @classmethod - def contract_name_to_abi(cls, contract_name: str) -> Dict: - """Return the ABI for the given contract name. - - First tries to get data from the class level storage - `_contract_name_to_abi`. If it's not there, loads it from disk, stores - it in the class data (for the next caller), and then returns it. - """ - try: - return cls._contract_name_to_abi[contract_name] - except KeyError: - cls._contract_name_to_abi[contract_name] = json.loads( - resource_string( - "zero_ex.contract_artifacts", - f"artifacts/{contract_name}.json", - ) - )["compilerOutput"]["abi"] - return cls._contract_name_to_abi[contract_name] - null_address = "0x0000000000000000000000000000000000000000" eip191_header = b"\x19\x01" @@ -358,7 +338,7 @@ def is_valid_signature( # false positive from pylint: disable=no-member contract: datatypes.Contract = web3_instance.eth.contract( address=to_checksum_address(contract_address), - abi=_Constants.contract_name_to_abi("Exchange"), + abi=zero_ex.contract_artifacts.abi_by_name("Exchange"), ) try: return ( diff --git a/python-packages/order_utils/test/test_doctest.py b/python-packages/order_utils/test/test_doctest.py deleted file mode 100644 index 297f75e756..0000000000 --- a/python-packages/order_utils/test/test_doctest.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Exercise doctests for all of our modules.""" - -from doctest import testmod -import pkgutil -import importlib - -import zero_ex - - -def test_all_doctests(): - """Gather zero_ex.* modules and doctest them.""" - for (_, modname, _) in pkgutil.walk_packages( - path=zero_ex.__path__, prefix="zero_ex." - ): - module = importlib.import_module(modname) - print(module) - (failure_count, _) = testmod(module) - assert failure_count == 0 From 680c365fd0ea54eae550a14f3e0ca0c14bc59405 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Fri, 4 Jan 2019 11:17:39 -0500 Subject: [PATCH 08/17] Add scripts to install, test & lint all components --- .circleci/config.yml | 80 +++--------------------- python-packages/cmd_pkgs_in_dep_order.py | 24 +++++++ python-packages/install | 13 ++++ python-packages/install_editable | 13 ++++ python-packages/lint | 13 ++++ python-packages/sra_client/setup.py | 10 +++ python-packages/test | 13 ++++ 7 files changed, 93 insertions(+), 73 deletions(-) create mode 100755 python-packages/cmd_pkgs_in_dep_order.py create mode 100755 python-packages/install create mode 100755 python-packages/install_editable create mode 100755 python-packages/lint create mode 100755 python-packages/test diff --git a/.circleci/config.yml b/.circleci/config.yml index 2763423ba8..9b203c323c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -202,53 +202,18 @@ jobs: key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - run: command: | - cd python-packages/contract_addresses + cd python-packages python -m ensurepip - python -m pip install . - - run: - command: | - cd python-packages/contract_artifacts - python -m ensurepip - python -m pip install . - - run: - command: | - cd python-packages/order_utils - python -m ensurepip - python -m pip install -e .[dev] - - run: - command: | - cd python-packages/sra_client - python -m ensurepip - python -m pip install -e . + ./install - 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/contract_addresses - coverage run setup.py test - - run: - command: | - cd python-packages/contract_artifacts - coverage run setup.py test - - run: - command: | - cd python-packages/contract_demo - coverage run setup.py test - - run: - command: | - cd python-packages/order_utils - coverage run setup.py test - run: command: | - cd python-packages/sra_client - coverage run setup.py test + cd python-packages + ./cmd_pkgs_in_dep_order.py coverage run setup.py test - save_cache: key: coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }} paths: @@ -309,45 +274,15 @@ jobs: key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - run: command: | - cd python-packages/contract_addresses - python -m ensurepip - python -m pip install .[dev] - - run: - command: | - cd python-packages/contract_artifacts - python -m ensurepip - python -m pip install .[dev] - - run: - command: | - cd python-packages/contract_demo - python -m ensurepip - python -m pip install .[dev] - - run: - command: | - cd python-packages/order_utils python -m ensurepip - python -m pip install -e .[dev] + cd python-packages + ./install + ./lint - save_cache: key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} paths: - '/usr/local/bin' - '/usr/local/lib/python3.7/site-packages' - - run: - command: | - cd python-packages/contract_addresses - python setup.py lint - - run: - command: | - cd python-packages/contract_artifacts - python setup.py lint - - run: - command: | - cd python-packages/contract_demo - python setup.py lint - - run: - command: | - cd python-packages/order_utils - python setup.py lint static-tests: working_directory: ~/repo docker: @@ -463,6 +398,5 @@ workflows: - test-rest - 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 diff --git a/python-packages/cmd_pkgs_in_dep_order.py b/python-packages/cmd_pkgs_in_dep_order.py new file mode 100755 index 0000000000..c5ca097384 --- /dev/null +++ b/python-packages/cmd_pkgs_in_dep_order.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +"""Run a command in every package, in order of increasing dependency.""" + +import os +import subprocess +import sys + + +PACKAGE_DEPENDENCY_LIST = [ + # Order matters! Packages must be handled in dependency order (most + # independent first) in order for them to resolve properly. + "contract_addresses", + "contract_artifacts", + "sra_client", + "order_utils", + "contract_demo" +] + +for package in PACKAGE_DEPENDENCY_LIST: + print(f"Running command `{sys.argv[1:]}` in package {package}") + os.chdir(package) + subprocess.check_call(sys.argv[1:]) + os.chdir("..") diff --git a/python-packages/install b/python-packages/install new file mode 100755 index 0000000000..73d88fec27 --- /dev/null +++ b/python-packages/install @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +"""Install all packages in non-editable mode (no -e on pip install).""" + +from os import path +import subprocess + +# install all packages +subprocess.check_call( + ( + path.join(".", "cmd_pkgs_in_dep_order.py") + " pip install .[dev]" + ).split() +) diff --git a/python-packages/install_editable b/python-packages/install_editable new file mode 100755 index 0000000000..6ac68b289c --- /dev/null +++ b/python-packages/install_editable @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +"""Script to install all packages in editable mode (pip install -e .).""" + +from os import path +import subprocess + +# install all packages +subprocess.check_call( + ( + path.join(".", "cmd_pkgs_in_dep_order.py") + " pip install -e .[dev]" + ).split() +) diff --git a/python-packages/lint b/python-packages/lint new file mode 100755 index 0000000000..0974f273c6 --- /dev/null +++ b/python-packages/lint @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +"""Script to run linters against local copy of all components.""" + +from os import path +import subprocess + +subprocess.check_call( + ( + f"{path.join('.', 'cmd_pkgs_in_dep_order.py')}" + + f" {path.join('.', 'setup.py')} lint" + ).split() +) diff --git a/python-packages/sra_client/setup.py b/python-packages/sra_client/setup.py index b47f71ae74..0921149bd4 100755 --- a/python-packages/sra_client/setup.py +++ b/python-packages/sra_client/setup.py @@ -48,6 +48,15 @@ def run(self): subprocess.check_call("twine upload dist/*".split()) # nosec +class LintCommand(distutils.command.build_py.build_py): + """No-op lint command to support top-level lint script.""" + + description = "No-op" + + def run(self): + pass + + setup( name=NAME, version=VERSION, @@ -63,5 +72,6 @@ def run(self): cmdclass={ "test_publish": TestPublishCommand, "publish": PublishCommand, + "lint": LintCommand, }, ) diff --git a/python-packages/test b/python-packages/test new file mode 100755 index 0000000000..5bf37cca3f --- /dev/null +++ b/python-packages/test @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +"""Script to run tests against local copy of all components.""" + +from os import path +import subprocess + +subprocess.check_call( + ( + f"{path.join('.', 'cmd_pkgs_in_dep_order.py')}" + + f" {path.join('.', 'setup.py')} test" + ).split() +) From 46c72f2ee67ee1edf03cde020da1b0a963de99a9 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Fri, 4 Jan 2019 12:05:26 -0500 Subject: [PATCH 09/17] prettierignore files in local python dev env --- .prettierignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.prettierignore b/.prettierignore index a509c4f882..9d8f611c1a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -27,3 +27,6 @@ lib package.json scripts/postpublish_utils.js packages/sol-cov/test/fixtures/artifacts +.mypy_cache +.tox +.pytest_cache From 4febc6d80ba0a19fef4d8e8c8f6c2a015198261b Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Fri, 4 Jan 2019 14:06:21 -0500 Subject: [PATCH 10/17] Correct missing coverage analysis for sra_client --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9b203c323c..607df9b966 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -360,6 +360,9 @@ jobs: - restore_cache: keys: - coverage-python-contract-demo-{{ .Environment.CIRCLE_SHA1 }} + - restore_cache: + keys: + - coverage-python-sra-client-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: keys: - coverage-python-order-utils-{{ .Environment.CIRCLE_SHA1 }} From b2b19b11496243de5bd332e9f459caa1ca972b70 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Fri, 4 Jan 2019 14:53:28 -0500 Subject: [PATCH 11/17] CI cache lint: don't save, re-use from test-python --- .circleci/config.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 607df9b966..c1bb7a5b94 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -278,11 +278,6 @@ jobs: cd python-packages ./install ./lint - - save_cache: - key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - paths: - - '/usr/local/bin' - - '/usr/local/lib/python3.7/site-packages' static-tests: working_directory: ~/repo docker: @@ -400,6 +395,9 @@ workflows: requires: - test-rest - test-python + - static-tests-python: + requires: + - test-python - test-python # skip python tox run for now, as we don't yet have multiple test environments to support. #- test-rest-python From 7ae3b8272c9ba815ea11b25eb8b28b21e42aa2a4 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Tue, 8 Jan 2019 17:11:05 -0500 Subject: [PATCH 12/17] correct merge mistake --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0d2d6b0e07..9dbd8f1993 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -210,10 +210,6 @@ jobs: paths: - '/usr/local/bin' - '/usr/local/lib/python3.7/site-packages' - cd python-packages/json_schemas - coverage run setup.py test - - run: - command: | - run: command: | cd python-packages From 0a56374c00b4df60c363c8091953fdacbf310d07 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Tue, 8 Jan 2019 17:01:52 -0500 Subject: [PATCH 13/17] tag hacks as hacks --- python-packages/contract_artifacts/setup.py | 2 +- python-packages/json_schemas/setup.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python-packages/contract_artifacts/setup.py b/python-packages/contract_artifacts/setup.py index 7d738e48f0..8d93fc3fab 100755 --- a/python-packages/contract_artifacts/setup.py +++ b/python-packages/contract_artifacts/setup.py @@ -30,7 +30,7 @@ def run(self): "mypy src setup.py".split(), # security issue checker: "bandit -r src ./setup.py".split(), - # ensure contract artifacts match the authoritative copies: + # HACK: ensure contract artifacts match the authoritative copies: # this is a hack. ideally we would symlink to the authoritative # copies, but a problem with setuptools is preventing it from # following symlinks when gathering package_data. see diff --git a/python-packages/json_schemas/setup.py b/python-packages/json_schemas/setup.py index 5c1e66d95e..be4468e5c7 100755 --- a/python-packages/json_schemas/setup.py +++ b/python-packages/json_schemas/setup.py @@ -41,10 +41,10 @@ def run(self): "mypy src test setup.py".split(), # security issue checker: "bandit -r src ./setup.py".split(), - # ensure json schemas don't differ from the authoritative copies: - # this is a hack. ideally we would symlink to the authoritative - # copies, but a problem with setuptools is preventing it from - # following symlinks when gathering package_data. see + # HACK: ensure json schemas don't differ from the authoritative + # copies: this is a hack. ideally we would symlink to the + # authoritative copies, but a problem with setuptools is preventing + # it from following symlinks when gathering package_data. see # https://github.com/pypa/setuptools/issues/415. ( "diff src/zero_ex/json_schemas/schemas" From fa5230e896f25400fc0383256dec10a909f2b581 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Tue, 8 Jan 2019 17:06:58 -0500 Subject: [PATCH 14/17] remove local strip_0x() in favor of eth_utils --- .../src/zero_ex/order_utils/__init__.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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 867f59d719..4697ad99cc 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 @@ -18,7 +18,7 @@ from mypy_extensions import TypedDict -from eth_utils import keccak, to_bytes, to_checksum_address +from eth_utils import keccak, remove_0x_prefix, to_bytes, to_checksum_address from web3 import Web3 import web3.exceptions from web3.providers.base import BaseProvider @@ -214,13 +214,12 @@ def jsdict_order_to_struct(jsdict: dict) -> Order: order = cast(Order, copy(jsdict)) - def strip_0x(hex_string: str) -> str: - if hex_string.startswith("0x"): - return hex_string[2:] - return hex_string - - order["makerAssetData"] = bytes.fromhex(strip_0x(jsdict["makerAssetData"])) - order["takerAssetData"] = bytes.fromhex(strip_0x(jsdict["takerAssetData"])) + order["makerAssetData"] = bytes.fromhex( + remove_0x_prefix(jsdict["makerAssetData"]) + ) + order["takerAssetData"] = bytes.fromhex( + remove_0x_prefix(jsdict["takerAssetData"]) + ) del order["exchangeAddress"] # type: ignore # silence mypy pending release of From c8922af8bc401aa55f09ff9737376434e8c8e0a2 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Tue, 8 Jan 2019 17:35:50 -0500 Subject: [PATCH 15/17] remove json schemas from old order_utils location --- .../src/zero_ex/json_schemas/py.typed | 0 .../json_schemas/schemas/address_schema.json | 5 -- .../asset_pairs_request_opts_schema.json | 8 --- .../schemas/block_param_schema.json | 11 ---- .../schemas/block_range_schema.json | 8 --- .../schemas/call_data_schema.json | 27 ---------- .../ec_signature_parameter_schema.json | 5 -- .../schemas/ec_signature_schema.json | 14 ----- .../schemas/eip712_typed_data_schema.json | 28 ---------- .../json_schemas/schemas/hex_schema.json | 5 -- .../schemas/index_filter_values_schema.json | 7 --- .../json_schemas/schemas/js_number.json | 5 -- .../json_schemas/schemas/number_schema.json | 5 -- .../schemas/order_cancel_schema.json | 12 ----- .../schemas/order_config_request_schema.json | 24 --------- .../order_fill_or_kill_requests_schema.json | 12 ----- .../schemas/order_fill_requests_schema.json | 12 ----- .../schemas/order_hash_schema.json | 5 -- .../json_schemas/schemas/order_schema.json | 34 ------------ ...der_watcher_web_socket_request_schema.json | 52 ------------------- ...atcher_web_socket_utf8_message_schema.json | 10 ---- .../schemas/orderbook_request_schema.json | 9 ---- .../schemas/orders_request_opts_schema.json | 19 ------- .../json_schemas/schemas/orders_schema.json | 5 -- .../schemas/paged_request_opts_schema.json | 8 --- .../schemas/paginated_collection_schema.json | 10 ---- ..._api_asset_data_pairs_response_schema.json | 13 ----- .../relayer_api_asset_data_pairs_schema.json | 12 ----- ...ayer_api_asset_data_trade_info_schema.json | 11 ---- .../relayer_api_error_response_schema.json | 21 -------- ...er_api_fee_recipients_response_schema.json | 16 ------ ...layer_api_order_config_payload_schema.json | 24 --------- ...ayer_api_order_config_response_schema.json | 11 ---- .../schemas/relayer_api_order_schema.json | 9 ---- ...relayer_api_orderbook_response_schema.json | 9 ---- ...ders_channel_subscribe_payload_schema.json | 14 ----- ...r_api_orders_channel_subscribe_schema.json | 11 ---- ...orders_channel_update_response_schema.json | 11 ---- .../relayer_api_orders_response_schema.json | 13 ----- .../schemas/relayer_api_orders_schema.json | 5 -- .../schemas/request_opts_schema.json | 7 --- .../schemas/signed_order_schema.json | 12 ----- .../schemas/signed_orders_schema.json | 5 -- .../json_schemas/schemas/token_schema.json | 11 ---- .../json_schemas/schemas/tx_data_schema.json | 26 ---------- .../schemas/whole_number_schema.json | 12 ----- .../schemas/zero_ex_transaction_schema.json | 10 ---- 47 files changed, 603 deletions(-) delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/py.typed delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/address_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/asset_pairs_request_opts_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_param_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_range_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/call_data_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_parameter_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/eip712_typed_data_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/hex_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/index_filter_values_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/js_number.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/number_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_cancel_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_config_request_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_or_kill_requests_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_requests_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_hash_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_request_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_utf8_message_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/orderbook_request_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_request_opts_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/paged_request_opts_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/paginated_collection_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_response_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_trade_info_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_error_response_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_fee_recipients_response_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_payload_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_response_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orderbook_response_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_update_response_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_response_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/request_opts_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_order_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_orders_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/token_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/tx_data_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/whole_number_schema.json delete mode 100644 python-packages/order_utils/src/zero_ex/json_schemas/schemas/zero_ex_transaction_schema.json diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/py.typed b/python-packages/order_utils/src/zero_ex/json_schemas/py.typed deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/address_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/address_schema.json deleted file mode 100644 index 0dc02d3313..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/address_schema.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "/addressSchema", - "type": "string", - "pattern": "^0x[0-9a-f]{40}$" -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/asset_pairs_request_opts_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/asset_pairs_request_opts_schema.json deleted file mode 100644 index 174a8fdc32..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/asset_pairs_request_opts_schema.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/AssetPairsRequestOpts", - "type": "object", - "properties": { - "assetDataA": { "$ref": "/hexSchema" }, - "assetDataB": { "$ref": "/hexSchema" } - } -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_param_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_param_schema.json deleted file mode 100644 index ed4dd1e875..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_param_schema.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "/blockParamSchema", - "oneOf": [ - { - "type": "number" - }, - { - "enum": ["latest", "earliest", "pending"] - } - ] -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_range_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_range_schema.json deleted file mode 100644 index b142946490..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/block_range_schema.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/blockRangeSchema", - "properties": { - "fromBlock": { "$ref": "/blockParamSchema" }, - "toBlock": { "$ref": "/blockParamSchema" } - }, - "type": "object" -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/call_data_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/call_data_schema.json deleted file mode 100644 index c5972e8c18..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/call_data_schema.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_parameter_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_parameter_schema.json deleted file mode 100644 index 0c08ec2403..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_parameter_schema.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "/ecSignatureParameterSchema", - "type": "string", - "pattern": "^0[xX][0-9A-Fa-f]{64}$" -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_schema.json deleted file mode 100644 index bc79ca5e96..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/ec_signature_schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/eip712_typed_data_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/eip712_typed_data_schema.json deleted file mode 100644 index 8efd6de448..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/eip712_typed_data_schema.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/hex_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/hex_schema.json deleted file mode 100644 index f37815d5bd..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/hex_schema.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "/hexSchema", - "type": "string", - "pattern": "^0x(([0-9a-f][0-9a-f])+)?$" -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/index_filter_values_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/index_filter_values_schema.json deleted file mode 100644 index bec00d79e8..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/index_filter_values_schema.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id": "/indexFilterValuesSchema", - "additionalProperties": { - "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/addressSchema" }, { "$ref": "/orderHashSchema" }] - }, - "type": "object" -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/js_number.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/js_number.json deleted file mode 100644 index 6a72d92c07..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/js_number.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "/jsNumber", - "type": "number", - "minimum": 0 -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/number_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/number_schema.json deleted file mode 100644 index a48f3e8cff..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/number_schema.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "/numberSchema", - "type": "string", - "pattern": "^\\d+(\\.\\d+)?$" -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_cancel_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_cancel_schema.json deleted file mode 100644 index 8d0999941a..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_cancel_schema.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "/orderCancellationRequestsSchema", - "type": "array", - "items": { - "properties": { - "order": { "$ref": "/orderSchema" }, - "takerTokenCancelAmount": { "$ref": "/wholeNumberSchema" } - }, - "required": ["order", "takerTokenCancelAmount"], - "type": "object" - } -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_config_request_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_config_request_schema.json deleted file mode 100644 index ca9b2e30ee..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_config_request_schema.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "/OrderConfigRequest", - "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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_or_kill_requests_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_or_kill_requests_schema.json deleted file mode 100644 index 73bbf20bb1..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_or_kill_requests_schema.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "/orderFillOrKillRequestsSchema", - "type": "array", - "items": { - "properties": { - "signedOrder": { "$ref": "/signedOrderSchema" }, - "fillTakerAmount": { "$ref": "/wholeNumberSchema" } - }, - "required": ["signedOrder", "fillTakerAmount"], - "type": "object" - } -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_requests_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_requests_schema.json deleted file mode 100644 index d06fb19a29..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_fill_requests_schema.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "/orderFillRequestsSchema", - "type": "array", - "items": { - "properties": { - "signedOrder": { "$ref": "/signedOrderSchema" }, - "takerTokenFillAmount": { "$ref": "/wholeNumberSchema" } - }, - "required": ["signedOrder", "takerTokenFillAmount"], - "type": "object" - } -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_hash_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_hash_schema.json deleted file mode 100644 index 4a770579fc..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_hash_schema.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "/orderHashSchema", - "type": "string", - "pattern": "^0x[0-9a-fA-F]{64}$" -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_schema.json deleted file mode 100644 index c70b9e2ddf..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_schema.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_request_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_request_schema.json deleted file mode 100644 index b0c419f94f..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_request_schema.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "id": "/orderWatcherWebSocketRequestSchema", - "type": "object", - "definitions": { - "signedOrderParam": { - "type": "object", - "properties": { - "signedOrder": { "$ref": "/signedOrderSchema" } - }, - "required": ["signedOrder"] - }, - "orderHashParam": { - "type": "object", - "properties": { - "orderHash": { "$ref": "/hexSchema" } - }, - "required": ["orderHash"] - } - }, - "oneOf": [ - { - "type": "object", - "properties": { - "id": { "type": "number" }, - "jsonrpc": { "type": "string" }, - "method": { "enum": ["ADD_ORDER"] }, - "params": { "$ref": "#/definitions/signedOrderParam" } - }, - "required": ["id", "jsonrpc", "method", "params"] - }, - { - "type": "object", - "properties": { - "id": { "type": "number" }, - "jsonrpc": { "type": "string" }, - "method": { "enum": ["REMOVE_ORDER"] }, - "params": { "$ref": "#/definitions/orderHashParam" } - }, - "required": ["id", "jsonrpc", "method", "params"] - }, - { - "type": "object", - "properties": { - "id": { "type": "number" }, - "jsonrpc": { "type": "string" }, - "method": { "enum": ["GET_STATS"] }, - "params": {} - }, - "required": ["id", "jsonrpc", "method"] - } - ] -} \ No newline at end of file diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_utf8_message_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_utf8_message_schema.json deleted file mode 100644 index 154d6d754d..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/order_watcher_web_socket_utf8_message_schema.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "/orderWatcherWebSocketUtf8MessageSchema", - "properties": { - "utf8Data": { "type": "string" } - }, - "required": [ - "utf8Data" - ], - "type": "object" -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orderbook_request_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orderbook_request_schema.json deleted file mode 100644 index 27848bdcb1..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orderbook_request_schema.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "/OrderBookRequest", - "type": "object", - "properties": { - "baseAssetData": { "$ref": "/hexSchema" }, - "quoteAssetData": { "$ref": "/hexSchema" } - }, - "required": ["baseAssetData", "quoteAssetData"] -} \ No newline at end of file diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_request_opts_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_request_opts_schema.json deleted file mode 100644 index 10da510607..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_request_opts_schema.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "id": "/OrdersRequestOpts", - "type": "object", - "properties": { - "makerAssetProxyId": { "$ref": "/hexSchema" }, - "takerAssetProxyId": { "$ref": "/hexSchema" }, - "makerAssetAddress": { "$ref": "/addressSchema" }, - "takerAssetAddress": { "$ref": "/addressSchema" }, - "exchangeAddress": { "$ref": "/addressSchema" }, - "senderAddress": { "$ref": "/addressSchema" }, - "makerAssetData": { "$ref": "/hexSchema" }, - "takerAssetData": { "$ref": "/hexSchema" }, - "traderAssetData": { "$ref": "/hexSchema" }, - "makerAddress": { "$ref": "/addressSchema" }, - "takerAddress": { "$ref": "/addressSchema" }, - "traderAddress": { "$ref": "/addressSchema" }, - "feeRecipientAddress": { "$ref": "/addressSchema" } - } -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_schema.json deleted file mode 100644 index 1e1c6a8751..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/orders_schema.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "/ordersSchema", - "type": "array", - "items": { "$ref": "/orderSchema" } -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/paged_request_opts_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/paged_request_opts_schema.json deleted file mode 100644 index 7cfc73947b..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/paged_request_opts_schema.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/PagedRequestOpts", - "type": "object", - "properties": { - "page": { "type": "number" }, - "perPage": { "type": "number" } - } -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/paginated_collection_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/paginated_collection_schema.json deleted file mode 100644 index 9dcedf5b47..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/paginated_collection_schema.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "/paginatedCollectionSchema", - "type": "object", - "properties": { - "total": { "type": "number" }, - "perPage": { "type": "number" }, - "page": { "type": "number" } - }, - "required": ["total", "perPage", "page"] -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_response_schema.json deleted file mode 100644 index d1150d3dbc..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_response_schema.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": "/relayerApiAssetDataPairsResponseSchema", - "type": "object", - "allOf": [ - { "$ref": "/paginatedCollectionSchema" }, - { - "properties": { - "records": { "$ref": "/relayerApiAssetDataPairsSchema" } - }, - "required": ["records"] - } - ] -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_schema.json deleted file mode 100644 index 62d4745b8c..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_pairs_schema.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "/relayerApiAssetDataPairsSchema", - "type": "array", - "items": { - "properties": { - "assetDataA": { "$ref": "/relayerApiAssetDataTradeInfoSchema" }, - "assetDataB": { "$ref": "/relayerApiAssetDataTradeInfoSchema" } - }, - "required": ["assetDataA", "assetDataB"], - "type": "object" - } -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_trade_info_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_trade_info_schema.json deleted file mode 100644 index e0f274c5d8..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_asset_data_trade_info_schema.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "/relayerApiAssetDataTradeInfoSchema", - "type": "object", - "properties": { - "assetData": { "$ref": "/hexSchema" }, - "minAmount": { "$ref": "/wholeNumberSchema" }, - "maxAmount": { "$ref": "/wholeNumberSchema" }, - "precision": { "type": "number" } - }, - "required": ["assetData"] -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_error_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_error_response_schema.json deleted file mode 100644 index be4659b0bd..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_error_response_schema.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_fee_recipients_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_fee_recipients_response_schema.json deleted file mode 100644 index c73506dbb1..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_fee_recipients_response_schema.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "/relayerApiFeeRecipientsResponseSchema", - "type": "object", - "allOf": [ - { "$ref": "/paginatedCollectionSchema" }, - { - "properties": { - "records": { - "type": "array", - "items": { "$ref": "/addressSchema" } - } - }, - "required": ["records"] - } - ] -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_payload_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_payload_schema.json deleted file mode 100644 index f4583fc625..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_payload_schema.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_response_schema.json deleted file mode 100644 index 8193861e12..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_config_response_schema.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_schema.json deleted file mode 100644 index e0f6539b9f..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_order_schema.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "/relayerApiOrderSchema", - "type": "object", - "properties": { - "order": { "$ref": "/orderSchema" }, - "metaData": { "type": "object" } - }, - "required": ["order", "metaData"] -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orderbook_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orderbook_response_schema.json deleted file mode 100644 index b44f2a7408..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orderbook_response_schema.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "/relayerApiOrderbookResponseSchema", - "type": "object", - "properties": { - "bids": { "$ref": "/relayerApiOrdersResponseSchema" }, - "asks": { "$ref": "/relayerApiOrdersResponseSchema" } - }, - "required": ["bids", "asks"] -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json deleted file mode 100644 index 274ef1625a..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_schema.json deleted file mode 100644 index 29561d09fc..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_subscribe_schema.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "/relayerApiOrdersChannelSubscribeSchema", - "type": "object", - "properties": { - "type": { "enum": ["subscribe"] }, - "channel": { "enum": ["orders"] }, - "requestId": { "type": "string" }, - "payload": { "$ref": "/relayerApiOrdersChannelSubscribePayloadSchema" } - }, - "required": ["type", "channel", "requestId"] -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_update_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_update_response_schema.json deleted file mode 100644 index 239e7c5861..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_channel_update_response_schema.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "/relayerApiOrdersChannelUpdateSchema", - "type": "object", - "properties": { - "type": { "enum": ["update"] }, - "channel": { "enum": ["orders"] }, - "requestId": { "type": "string" }, - "payload": { "$ref": "/relayerApiOrdersSchema" } - }, - "required": ["type", "channel", "requestId"] -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_response_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_response_schema.json deleted file mode 100644 index a5023a3fc1..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_response_schema.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": "/relayerApiOrdersResponseSchema", - "type": "object", - "allOf": [ - { "$ref": "/paginatedCollectionSchema" }, - { - "properties": { - "records": { "$ref": "/relayerApiOrdersSchema" } - }, - "required": ["records"] - } - ] -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_schema.json deleted file mode 100644 index 84e75cd045..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/relayer_api_orders_schema.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "/relayerApiOrdersSchema", - "type": "array", - "items": { "$ref": "/relayerApiOrderSchema" } -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/request_opts_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/request_opts_schema.json deleted file mode 100644 index b50547d180..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/request_opts_schema.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id": "/RequestOpts", - "type": "object", - "properties": { - "networkId": { "type": "number" } - } -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_order_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_order_schema.json deleted file mode 100644 index 137ae4a249..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_order_schema.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "/signedOrderSchema", - "allOf": [ - { "$ref": "/orderSchema" }, - { - "properties": { - "signature": { "$ref": "/hexSchema" } - }, - "required": ["signature"] - } - ] -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_orders_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_orders_schema.json deleted file mode 100644 index e7c3a0b6c9..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/signed_orders_schema.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "/signedOrdersSchema", - "type": "array", - "items": { "$ref": "/signedOrderSchema" } -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/token_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/token_schema.json deleted file mode 100644 index 31e41c4b87..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/token_schema.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/tx_data_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/tx_data_schema.json deleted file mode 100644 index 4643521ce4..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/tx_data_schema.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "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/python-packages/order_utils/src/zero_ex/json_schemas/schemas/whole_number_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/whole_number_schema.json deleted file mode 100644 index aa469954ca..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/whole_number_schema.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "/wholeNumberSchema", - "anyOf": [ - { - "type": "string", - "pattern": "^\\d+$" - }, - { - "type": "integer" - } - ] -} diff --git a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/zero_ex_transaction_schema.json b/python-packages/order_utils/src/zero_ex/json_schemas/schemas/zero_ex_transaction_schema.json deleted file mode 100644 index 0c714f14d9..0000000000 --- a/python-packages/order_utils/src/zero_ex/json_schemas/schemas/zero_ex_transaction_schema.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "/zeroExTransactionSchema", - "properties": { - "data": { "$ref": "/hexSchema" }, - "signerAddress": { "$ref": "/addressSchema" }, - "salt": { "$ref": "/wholeNumberSchema" } - }, - "required": ["data", "salt", "signerAddress"], - "type": "object" -} From 766df750487053c3a932009003e5916697e1f4f2 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Tue, 8 Jan 2019 17:50:10 -0500 Subject: [PATCH 16/17] correct merge mistake --- .circleci/config.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9dbd8f1993..9c6c1082fa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -276,21 +276,12 @@ jobs: - 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/json_schemas - python -m ensurepip - python -m pip install .[dev] - run: command: | python -m ensurepip cd python-packages ./install ./lint - cd python-packages/json_schemas - python setup.py lint - - run: - command: | static-tests: working_directory: ~/repo docker: From ced598c047e88af8c37894c98c8e9f27c6526bb0 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Tue, 8 Jan 2019 18:01:04 -0500 Subject: [PATCH 17/17] doctest json schemas via command-line, not code --- python-packages/json_schemas/setup.py | 2 +- .../json_schemas/test/test_doctest.py | 25 ------------------- 2 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 python-packages/json_schemas/test/test_doctest.py diff --git a/python-packages/json_schemas/setup.py b/python-packages/json_schemas/setup.py index be4468e5c7..389d145913 100755 --- a/python-packages/json_schemas/setup.py +++ b/python-packages/json_schemas/setup.py @@ -20,7 +20,7 @@ def run_tests(self): """Invoke pytest.""" import pytest - exit(pytest.main()) + exit(pytest.main(["--doctest-modules"])) class LintCommand(distutils.command.build_py.build_py): diff --git a/python-packages/json_schemas/test/test_doctest.py b/python-packages/json_schemas/test/test_doctest.py deleted file mode 100644 index 2aa576422b..0000000000 --- a/python-packages/json_schemas/test/test_doctest.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Exercise doctests for all of our modules.""" - -from doctest import testmod -import pkgutil -import importlib - -import zero_ex.json_schemas - - -def test_all_doctests(): - """Gather zero_ex.json_schemas.* modules and doctest them.""" - # json_schemas module - module = "zero_ex.json_schemas" - print(module) - failure_count, _ = testmod(importlib.import_module(module)) - assert failure_count == 0 - - # any json_schemas.* sub-modules - for (_, modname, _) in pkgutil.walk_packages( - path=zero_ex.json_schemas.__path__, prefix="zero_ex.json_schemas" - ): - module = importlib.import_module(modname) - print(module) - (failure_count, _) = testmod(module) - assert failure_count == 0