Compare commits
273 Commits
@0x/json-s
...
@0x/contra
Author | SHA1 | Date | |
---|---|---|---|
|
bbd3c03969 | ||
|
a4405c3d39 | ||
|
0fe4f587d8 | ||
|
d3c714bd17 | ||
|
c399b7a7d5 | ||
|
b9234e94fb | ||
|
417bb87785 | ||
|
0233ae3134 | ||
|
eed0c5dd59 | ||
|
2b3b167095 | ||
|
5d91d19808 | ||
|
0f374ddee9 | ||
|
a65a9913cd | ||
|
1ead32c666 | ||
|
d1af9fc780 | ||
|
0f06737fb6 | ||
|
1676231532 | ||
|
b1caf697c8 | ||
|
51481065fe | ||
|
e367da710c | ||
|
f493d6524d | ||
|
e1b85da2a7 | ||
|
22c6548ed1 | ||
|
afb32c087d | ||
|
bbc1ed1c64 | ||
|
3a46f1a27a | ||
|
90cd364780 | ||
|
6795e6f078 | ||
|
cfb3404349 | ||
|
0212f3ee78 | ||
|
6b2995a4ee | ||
|
09e7ac54d4 | ||
|
f69009d4a8 | ||
|
206802ae33 | ||
|
91d4138fb8 | ||
|
cb455f951a | ||
|
5f25d20cd0 | ||
|
1f0e2cd910 | ||
|
1749d02701 | ||
|
55ace3179c | ||
|
7866d9ccb4 | ||
|
51f73d07fa | ||
|
63d84674ab | ||
|
14066997b2 | ||
|
28561e765a | ||
|
453fbbdc5d | ||
|
1e1e5ec10d | ||
|
2088b0e459 | ||
|
58400d9e01 | ||
|
ac9375f1d2 | ||
|
db061c9355 | ||
|
d5ce6c464b | ||
|
b06205bb7f | ||
|
f528a3e1de | ||
|
bddfdacfad | ||
|
d3cdd3f235 | ||
|
41ae45ea40 | ||
|
657e0895ea | ||
|
0ae2d8bab5 | ||
|
3e0bd1f02d | ||
|
b2592d1cc2 | ||
|
aa3524c3b2 | ||
|
35fcfb978d | ||
|
c68083cf03 | ||
|
39deb1a05f | ||
|
302d08e290 | ||
|
05489dd7f1 | ||
|
cfb5119efc | ||
|
5d53fa5635 | ||
|
38d2b70ba6 | ||
|
29d5db16c2 | ||
|
a8128c5772 | ||
|
55bd076602 | ||
|
53a08d00fd | ||
|
fccec66463 | ||
|
bc26e807cd | ||
|
46dc37fb20 | ||
|
ccbb8400ee | ||
|
5d3d8a5332 | ||
|
7a224fe08f | ||
|
e045f5f74b | ||
|
e5c07ff0c5 | ||
|
cdf0aa27e4 | ||
|
88998e6bb7 | ||
|
b885dfa606 | ||
|
407495c278 | ||
|
ea50a94355 | ||
|
cb3318972e | ||
|
c057ad7977 | ||
|
eb21718462 | ||
|
7836e10d8a | ||
|
946a31821d | ||
|
92a915f477 | ||
|
60b458dbfb | ||
|
8b13efc89a | ||
|
88b625fa15 | ||
|
2cf9c9b7df | ||
|
d179d6a1a2 | ||
|
08502c1eb6 | ||
|
384cd47416 | ||
|
3bdeb82097 | ||
|
f49ab3f919 | ||
|
42d5bdd3ab | ||
|
7228cbfe92 | ||
|
250c46d6a4 | ||
|
f394d7dba9 | ||
|
ca595cd8cf | ||
|
9ce71739f5 | ||
|
d69da38f7d | ||
|
50f69f734f | ||
|
fc9c6c5434 | ||
|
6e941be1e9 | ||
|
9f677150a4 | ||
|
11e273337f | ||
|
ec807120c3 | ||
|
a5654debeb | ||
|
0869c0d8b0 | ||
|
b456c3f953 | ||
|
8297d68166 | ||
|
18ce6797e0 | ||
|
c1009d440e | ||
|
89ee6fe6db | ||
|
38a12475bc | ||
|
9a800264a2 | ||
|
8ce390be3c | ||
|
cc93532f4f | ||
|
37cc40521c | ||
|
5ac7ff7084 | ||
|
e682b82ca8 | ||
|
7cd1fd0aaa | ||
|
8cd99c5a40 | ||
|
ad83312009 | ||
|
9e3b1fe333 | ||
|
c3f42995f9 | ||
|
3d3a02c892 | ||
|
06bec227ad | ||
|
5d7803323c | ||
|
4303f9a025 | ||
|
fe4c5434fa | ||
|
9325bb70c5 | ||
|
b164557165 | ||
|
424f984ea8 | ||
|
78c704e3d1 | ||
|
50f1a8fbd8 | ||
|
0f90b7b5da | ||
|
bec4384a5d | ||
|
f361efae5a | ||
|
76ca2116ab | ||
|
33d8646dc5 | ||
|
3cb5190bc6 | ||
|
5bba06bef8 | ||
|
dd3f672a35 | ||
|
25ef3b8445 | ||
|
7eb2d290d8 | ||
|
678762910b | ||
|
da28a542c7 | ||
|
92602d33ad | ||
|
03f04f4bb3 | ||
|
0d4dd5ff0d | ||
|
884864cc58 | ||
|
7c199d83be | ||
|
5b4c29c4bb | ||
|
f97ee80955 | ||
|
547322ae63 | ||
|
db74db622e | ||
|
57318c0041 | ||
|
4eb0767834 | ||
|
92bb7808ce | ||
|
abfe7d1613 | ||
|
6c72239365 | ||
|
8001daad8c | ||
|
73a38ab4f4 | ||
|
281c207921 | ||
|
ae531eef5f | ||
|
d8b11238e6 | ||
|
d36eb04ae8 | ||
|
b97ba35279 | ||
|
46efe92a72 | ||
|
9cc27c7d1b | ||
|
7d3396f9c5 | ||
|
918ef13714 | ||
|
9d12462893 | ||
|
ed44e16a95 | ||
|
11e2fc5bc4 | ||
|
3e88f820b8 | ||
|
163750f8c2 | ||
|
4aabc5d791 | ||
|
c9a7b9dcc1 | ||
|
98075b5653 | ||
|
57ae5be916 | ||
|
8caf62997f | ||
|
f8656ad376 | ||
|
29c6c2a2ad | ||
|
dadab94644 | ||
|
f2db67ef02 | ||
|
7ec232a470 | ||
|
dc3569392c | ||
|
11999cd407 | ||
|
f786f8a7f6 | ||
|
aab39e6ae0 | ||
|
31d3968649 | ||
|
72b8ef33d9 | ||
|
2cd0b01019 | ||
|
a6bc0db896 | ||
|
7cba95b523 | ||
|
1b976130ce | ||
|
e9babc5a94 | ||
|
c8d0ff846c | ||
|
db1e9769d0 | ||
|
4b038b07ed | ||
|
4c17c142f9 | ||
|
65b2fa13ac | ||
|
c375199daa | ||
|
805131cf1e | ||
|
6f64115561 | ||
|
0aadb789a5 | ||
|
26ee4d626c | ||
|
a8939d3eda | ||
|
048e48b03a | ||
|
c2f34baee0 | ||
|
8961b476ef | ||
|
58e08335b5 | ||
|
ea8fc1d93f | ||
|
2968dfb2ae | ||
|
24783107ba | ||
|
365c056b0f | ||
|
88a7d9cca8 | ||
|
d8cf9d54aa | ||
|
df746c5ff4 | ||
|
aa29526ae4 | ||
|
f0b5616aba | ||
|
2eca95df00 | ||
|
f560c2e66a | ||
|
5e19496e32 | ||
|
aeadaba005 | ||
|
8dfda9ffdd | ||
|
91992bb034 | ||
|
34a93857a0 | ||
|
fbda096aa9 | ||
|
24a26aef70 | ||
|
ec7f9d8a63 | ||
|
cc7dec7a99 | ||
|
46384ce80d | ||
|
5aeb626045 | ||
|
d2a27f1a48 | ||
|
f07c67202f | ||
|
3a3658708a | ||
|
f3c5d19246 | ||
|
c66d8f202a | ||
|
ec641c171d | ||
|
773d624365 | ||
|
25bd97a014 | ||
|
5dd9e28f72 | ||
|
cc1ef6f268 | ||
|
967e361da3 | ||
|
398097900c | ||
|
b86473f3c7 | ||
|
3d361c6b4a | ||
|
3346024ea7 | ||
|
2fecf6c80b | ||
|
183b4fb7ee | ||
|
0e2afc5dcb | ||
|
91aa716c07 | ||
|
9977626de0 | ||
|
8bb3fb5bb3 | ||
|
6d7adb277e | ||
|
fef1bd13b5 | ||
|
910bba9976 | ||
|
cd2d756717 | ||
|
0a47d89963 | ||
|
65e5b09cd1 | ||
|
97a8c6e5af | ||
|
9d455b2bca |
@@ -4,18 +4,23 @@ jobs:
|
||||
build:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
environment:
|
||||
CONTRACTS_COMMIT_HASH: '9ed05f5'
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
|
||||
- run:
|
||||
# HACK(albrow): Without this, yarn commands will sometimes
|
||||
# fail with a "permission denied" error.
|
||||
name: Set npm path
|
||||
command: npm set prefix=/home/circleci/npm && echo 'export PATH=$HOME/circleci/npm/bin:$PATH' >> /home/circleci/.bashrc
|
||||
# HACK(feuGeneA): commented out this hack as we're changing
|
||||
# from a circleci-maintained container to a different
|
||||
# container, and this hack may not apply anymore, as
|
||||
# suggested by the non-existance of `/home/circleci/.bashrc`
|
||||
# when running the command below.
|
||||
# - run:
|
||||
# # HACK(albrow): Without this, yarn commands will sometimes
|
||||
# # fail with a "permission denied" error.
|
||||
# name: Set npm path
|
||||
# command: npm set prefix=/home/circleci/npm && echo 'export PATH=$HOME/circleci/npm/bin:$PATH' >> /home/circleci/.bashrc
|
||||
- run:
|
||||
name: install-yarn
|
||||
command: npm install --global yarn@1.9.4
|
||||
@@ -37,10 +42,12 @@ jobs:
|
||||
path: ~/repo/packages/python-contract-wrappers/generated
|
||||
- store_artifacts:
|
||||
path: ~/repo/packages/abi-gen/test-cli/output
|
||||
- store_artifacts:
|
||||
path: ~/repo/packages/abi-gen-wrappers/generated_docs
|
||||
build-website:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -48,8 +55,9 @@ jobs:
|
||||
- repo-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- run: cd packages/website && yarn build:prod
|
||||
test-contracts-ganache:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -58,7 +66,7 @@ jobs:
|
||||
- run: yarn wsrun test:circleci @0x/contracts-multisig @0x/contracts-utils @0x/contracts-exchange-libs @0x/contracts-erc20 @0x/contracts-erc721 @0x/contracts-erc1155 @0x/contracts-extensions @0x/contracts-asset-proxy @0x/contracts-exchange @0x/contracts-exchange-forwarder @0x/contracts-coordinator @0x/contracts-dev-utils
|
||||
test-contracts-geth:
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
- image: 0xorg/devnet
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
@@ -71,7 +79,7 @@ jobs:
|
||||
test-publish:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
- image: 0xorg/verdaccio
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
@@ -81,7 +89,7 @@ jobs:
|
||||
- run: yarn test:publish:circleci
|
||||
test-doc-generation:
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -90,7 +98,7 @@ jobs:
|
||||
- run: yarn test:generate_docs:circleci
|
||||
test-rest:
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -107,7 +115,6 @@ jobs:
|
||||
- run: yarn wsrun test:circleci @0x/dev-utils
|
||||
- run: yarn wsrun test:circleci @0x/json-schemas
|
||||
- run: yarn wsrun test:circleci @0x/order-utils
|
||||
- run: yarn wsrun test:circleci @0x/order-watcher
|
||||
- run: yarn wsrun test:circleci @0x/sol-compiler
|
||||
- run: yarn wsrun test:circleci @0x/sol-tracing-utils
|
||||
- run: yarn wsrun test:circleci @0x/sol-doc
|
||||
@@ -151,10 +158,6 @@ jobs:
|
||||
key: coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/order-utils/coverage/lcov.info
|
||||
- save_cache:
|
||||
key: coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/order-watcher/coverage/lcov.info
|
||||
- save_cache:
|
||||
key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
@@ -178,18 +181,17 @@ jobs:
|
||||
test-python:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/python
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
- image: 0xorg/ganache-cli:2.2.2
|
||||
- image: 0xorg/launch-kit-ci
|
||||
- image: 0xorg/launch-kit-backend:74bcc39
|
||||
environment:
|
||||
RPC_URL: http://localhost:8545
|
||||
NETWORK_ID: 50
|
||||
WHITELIST_ALL_TOKENS: True
|
||||
command: bash -c "until curl -sfd'{\"method\":\"net_listening\"}' http://localhost:8545 | grep true; do continue; done; forever ts/lib/index.js"
|
||||
command: |
|
||||
sh -c "until printf 'POST /\r\nContent-Length: 26\r\n\r\n{\"method\":\"net_listening\"}' | nc localhost 8545 | grep true; do continue; done; node_modules/.bin/forever ts/lib/index.js"
|
||||
steps:
|
||||
- checkout
|
||||
- run: sudo chown -R circleci:circleci /usr/local/bin
|
||||
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
|
||||
- restore_cache:
|
||||
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
@@ -208,7 +210,7 @@ jobs:
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages
|
||||
./parallel coverage run setup.py test
|
||||
./parallel_without_sra_client coverage run setup.py test
|
||||
./build_docs
|
||||
- save_cache:
|
||||
key: coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }}
|
||||
@@ -255,11 +257,9 @@ jobs:
|
||||
test-rest-python:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/python
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
steps:
|
||||
- checkout
|
||||
- run: sudo chown -R circleci:circleci /usr/local/bin
|
||||
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
|
||||
- restore_cache:
|
||||
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- run:
|
||||
@@ -283,11 +283,9 @@ jobs:
|
||||
static-tests-python:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/python
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
steps:
|
||||
- checkout
|
||||
- run: sudo chown -R circleci:circleci /usr/local/bin
|
||||
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
|
||||
- restore_cache:
|
||||
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
@@ -302,7 +300,7 @@ jobs:
|
||||
static-tests:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
@@ -314,7 +312,7 @@ jobs:
|
||||
- run: yarn bundlewatch
|
||||
submit-coverage:
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -347,9 +345,6 @@ jobs:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
||||
|
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -4,4 +4,5 @@
|
||||
*.svg linguist-generated=true
|
||||
packages/contract-artifacts/artifacts/*json linguist-generated=true
|
||||
packages/abi-gen-wrappers/src/generated-wrappers/*.ts linguist-generated=true
|
||||
packages/contract-wrappers/src/generated-wrappers/*.ts linguist-generated=true
|
||||
|
||||
|
3
.github/autolabeler.yml
vendored
3
.github/autolabeler.yml
vendored
@@ -21,10 +21,7 @@ contracts: ['contracts']
|
||||
@0x/utils: ['packages/utils']
|
||||
@0x/tslint-config: ['packages/tslint-config']
|
||||
@0x/asset-buyer: ['packages/asset-buyer']
|
||||
@0x/order-watcher: ['packages/order-watcher']
|
||||
@0x/react-docs: ['packages/react-docs']
|
||||
@0x/order-utils: ['packages/order-utils']
|
||||
@0x/react-shared: ['packages/react-shared']
|
||||
@0x/assert: ['packages/assert']
|
||||
@0x/base-contract: ['packages/base-contract']
|
||||
@0x/typescript-typings: ['packages/typescript-typings']
|
||||
|
22
.gitignore
vendored
22
.gitignore
vendored
@@ -77,7 +77,6 @@ TODO.md
|
||||
|
||||
packages/website/public/bundle*
|
||||
packages/dev-tools-pages/public/bundle*
|
||||
packages/react-docs/example/public/bundle*
|
||||
|
||||
# server cli
|
||||
packages/testnet-faucets/server/
|
||||
@@ -115,9 +114,24 @@ contracts/exchange-forwarder/generated-wrappers/
|
||||
contracts/dev-utils/generated-wrappers/
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_token/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/exchange/__init__.py
|
||||
|
||||
# cli test output
|
||||
packages/abi-gen/test-cli/output
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/asset_proxy_owner/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/coordinator/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/coordinator_registry/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/dummy_erc20_token/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/dummy_erc721_token/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/dutch_auction/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_proxy/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc721_proxy/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc721_token/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/eth_balance_checker/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/forwarder/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/i_asset_proxy/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/i_validator/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/i_wallet/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/multi_asset_proxy/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/order_validator/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/weth9/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/zrx_token/__init__.py
|
||||
|
||||
# solc-bin in sol-compiler
|
||||
packages/sol-compiler/solc_bin/
|
||||
|
32
README.md
32
README.md
@@ -28,6 +28,7 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
|
||||
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| [`0x-contract-addresses`](/python-packages/contract_addresses) | [](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) | [](https://pypi.org/project/0x-contract-artifacts/) | 0x smart contract compilation artifacts |
|
||||
| [`0x-contract-wrappers`](/python-packages/contract_wrappers) | [](https://pypi.org/project/0x-contract-wrappers/) | 0x smart contract wrappers |
|
||||
| [`0x-json-schemas`](/python-packages/json_schemas) | [](https://pypi.org/project/0x-json-schemas/) | 0x-related JSON schemas |
|
||||
| [`0x-order-utils`](/python-packages/order_utils) | [](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) | [](https://pypi.org/project/0x-sra-client/) | A Python client for interacting with servers conforming to the Standard Relayer API specification |
|
||||
@@ -62,8 +63,7 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
||||
| [`@0x/contract-addresses`](/packages/contract-addresses) | [](https://www.npmjs.com/package/@0x/contract-addresses) | A tiny utility library for getting known deployed contract addresses for a particular network. |
|
||||
| [`@0x/contract-wrappers`](/packages/contract-wrappers) | [](https://www.npmjs.com/package/@0x/contract-wrappers) | JS/TS wrappers for interacting with the 0x smart contracts |
|
||||
| [`@0x/order-utils`](/packages/order-utils) | [](https://www.npmjs.com/package/@0x/order-utils) | A set of utilities for generating, parsing, signing and validating 0x orders |
|
||||
| [`@0x/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas |
|
||||
| [`@0x/order-watcher`](/packages/order-watcher) | [](https://www.npmjs.com/package/@0x/order-watcher) | An order watcher daemon that watches for order validity |
|
||||
| [`@0x/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas | |
|
||||
| [`@0x/migrations`](/packages/migrations) | [](https://www.npmjs.com/package/@0x/migrations) | Migration tool for deploying 0x smart contracts on private testnets |
|
||||
| [`@0x/contract-artifacts`](/packages/contract-artifacts) | [](https://www.npmjs.com/package/@0x/contract-artifacts) | 0x smart contract compilation artifacts |
|
||||
| [`@0x/abi-gen-wrappers`](/packages/abi-gen-wrappers) | [](https://www.npmjs.com/package/@0x/abi-gen-wrappers) | Low-level 0x smart contract wrappers generated using `@0x/abi-gen` |
|
||||
@@ -87,19 +87,17 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
||||
|
||||
#### Utilities
|
||||
|
||||
| Package | Version | Description |
|
||||
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
||||
| [`@0x/abi-gen`](/packages/abi-gen) | [](https://www.npmjs.com/package/@0x/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
|
||||
| [`@0x/tslint-config`](/packages/tslint-config) | [](https://www.npmjs.com/package/@0x/tslint-config) | Custom TSLint rules used by the 0x core team |
|
||||
| [`@0x/types`](/packages/types) | [](https://www.npmjs.com/package/@0x/types) | Shared type declarations |
|
||||
| [`@0x/typescript-typings`](/packages/typescript-typings) | [](https://www.npmjs.com/package/@0x/typescript-typings) | Repository of types for external packages |
|
||||
| [`@0x/utils`](/packages/utils) | [](https://www.npmjs.com/package/@0x/utils) | Shared utilities |
|
||||
| [`@0x/react-docs`](/packages/react-docs) | [](https://www.npmjs.com/package/@0x/react-docs) | React documentation component for rendering TypeDoc & sol-doc generated JSON |
|
||||
| [`@0x/react-shared`](/packages/react-shared) | [](https://www.npmjs.com/package/@0x/react-shared) | 0x shared react components |
|
||||
| [`@0x/assert`](/packages/assert) | [](https://www.npmjs.com/package/@0x/assert) | Type and schema assertions used by our packages |
|
||||
| [`@0x/base-contract`](/packages/base-contract) | [](https://www.npmjs.com/package/@0x/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
|
||||
| [`@0x/dev-utils`](/packages/dev-utils) | [](https://www.npmjs.com/package/@0x/dev-utils) | Dev utils to be shared across 0x packages |
|
||||
| [`@0x/fill-scenarios`](/packages/fill-scenarios) | [](https://www.npmjs.com/package/@0x/fill-scenarios) | 0x order fill scenario generator |
|
||||
| Package | Version | Description |
|
||||
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
|
||||
| [`@0x/abi-gen`](/packages/abi-gen) | [](https://www.npmjs.com/package/@0x/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
|
||||
| [`@0x/tslint-config`](/packages/tslint-config) | [](https://www.npmjs.com/package/@0x/tslint-config) | Custom TSLint rules used by the 0x core team |
|
||||
| [`@0x/types`](/packages/types) | [](https://www.npmjs.com/package/@0x/types) | Shared type declarations |
|
||||
| [`@0x/typescript-typings`](/packages/typescript-typings) | [](https://www.npmjs.com/package/@0x/typescript-typings) | Repository of types for external packages |
|
||||
| [`@0x/utils`](/packages/utils) | [](https://www.npmjs.com/package/@0x/utils) | Shared utilities |
|
||||
| [`@0x/assert`](/packages/assert) | [](https://www.npmjs.com/package/@0x/assert) | Type and schema assertions used by our packages |
|
||||
| [`@0x/base-contract`](/packages/base-contract) | [](https://www.npmjs.com/package/@0x/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
|
||||
| [`@0x/dev-utils`](/packages/dev-utils) | [](https://www.npmjs.com/package/@0x/dev-utils) | Dev utils to be shared across 0x packages |
|
||||
| [`@0x/fill-scenarios`](/packages/fill-scenarios) | [](https://www.npmjs.com/package/@0x/fill-scenarios) | 0x order fill scenario generator |
|
||||
|
||||
#### Private Packages
|
||||
|
||||
@@ -111,7 +109,7 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
||||
|
||||
## Usage
|
||||
|
||||
Node version >= 6.12 is required.
|
||||
Node version 6.x or 8.x is required.
|
||||
|
||||
Most of the packages require additional typings for external dependencies.
|
||||
You can include those by prepending the `@0x/typescript-typings` package to your [`typeRoots`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) config.
|
||||
@@ -140,6 +138,8 @@ Then install dependencies
|
||||
yarn install
|
||||
```
|
||||
|
||||
You will also need to have Python 3 installed, in order to build and run the tests of `abi-gen`'s command-line interface, which is integrated with the yarn build, yarn test, and yarn lint commands described below. More specifically, your local pip should resolve to the Python 3 version of pip, not a Python 2.x version.
|
||||
|
||||
### Build
|
||||
|
||||
To build all packages:
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "2.2.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "2.2.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.2.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564607468
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "2.2.3",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.2.6 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.5 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.4 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
||||
## v2.2.3 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-asset-proxy",
|
||||
"version": "2.2.3",
|
||||
"version": "2.2.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,20 +47,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/abi-gen": "^4.1.1",
|
||||
"@0x/contracts-gen": "^1.0.13",
|
||||
"@0x/contracts-test-utils": "^3.1.14",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "*",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -68,16 +69,16 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-erc1155": "^1.1.10",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-erc721": "^2.1.10",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/base-contract": "^5.3.2",
|
||||
"@0x/contracts-erc1155": "^1.1.13",
|
||||
"@0x/contracts-erc20": "^2.2.12",
|
||||
"@0x/contracts-erc721": "^2.1.13",
|
||||
"@0x/contracts-utils": "^3.2.2",
|
||||
"@0x/order-utils": "^8.3.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
|
@@ -37,6 +37,7 @@ describe('Authorizable', () => {
|
||||
artifacts.MixinAuthorizable,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
});
|
||||
beforeEach(async () => {
|
||||
|
@@ -23,7 +23,7 @@ import { LogWithDecodedArgs } from 'ethereum-types';
|
||||
import * as ethUtil from 'ethereumjs-util';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { ERC1155ProxyWrapper, ERC721ProxyContract } from '../src';
|
||||
import { artifacts, ERC1155ProxyContract, ERC1155ProxyWrapper } from '../src';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
@@ -51,7 +51,7 @@ describe('ERC1155Proxy', () => {
|
||||
let receiver: string;
|
||||
let receiverContract: string;
|
||||
// contracts & wrappers
|
||||
let erc1155Proxy: ERC721ProxyContract;
|
||||
let erc1155Proxy: ERC1155ProxyContract;
|
||||
let erc1155Receiver: DummyERC1155ReceiverContract;
|
||||
let erc1155ProxyWrapper: ERC1155ProxyWrapper;
|
||||
let erc1155Contract: ERC1155MintableContract;
|
||||
@@ -89,6 +89,7 @@ describe('ERC1155Proxy', () => {
|
||||
erc1155Artifacts.DummyERC1155Receiver,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
receiverContract = erc1155Receiver.address;
|
||||
await erc1155ProxyWrapper.setBalancesAndAllowancesAsync();
|
||||
|
@@ -31,6 +31,7 @@ import * as _ from 'lodash';
|
||||
|
||||
import {
|
||||
artifacts,
|
||||
ERC1155ProxyContract,
|
||||
ERC1155ProxyWrapper,
|
||||
ERC20ProxyContract,
|
||||
ERC20Wrapper,
|
||||
@@ -71,7 +72,7 @@ describe('Asset Transfer Proxies', () => {
|
||||
let erc721AFromTokenId: BigNumber;
|
||||
let erc721BFromTokenId: BigNumber;
|
||||
|
||||
let erc1155Proxy: ERC721ProxyContract;
|
||||
let erc1155Proxy: ERC1155ProxyContract;
|
||||
let erc1155ProxyWrapper: ERC1155ProxyWrapper;
|
||||
let erc1155Contract: ERC1155MintableContract;
|
||||
let erc1155Contract2: ERC1155MintableContract;
|
||||
@@ -100,6 +101,7 @@ describe('Asset Transfer Proxies', () => {
|
||||
artifacts.MultiAssetProxy,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
|
||||
// Configure ERC20Proxy
|
||||
@@ -172,6 +174,7 @@ describe('Asset Transfer Proxies', () => {
|
||||
erc20Artifacts.DummyNoReturnERC20Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.DUMMY_TOKEN_NAME,
|
||||
constants.DUMMY_TOKEN_SYMBOL,
|
||||
constants.DUMMY_TOKEN_DECIMALS,
|
||||
@@ -181,6 +184,7 @@ describe('Asset Transfer Proxies', () => {
|
||||
erc20Artifacts.DummyMultipleReturnERC20Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.DUMMY_TOKEN_NAME,
|
||||
constants.DUMMY_TOKEN_SYMBOL,
|
||||
constants.DUMMY_TOKEN_DECIMALS,
|
||||
@@ -223,6 +227,7 @@ describe('Asset Transfer Proxies', () => {
|
||||
erc721Artifacts.DummyERC721Receiver,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
|
||||
await erc721Wrapper.setBalancesAndAllowancesAsync();
|
||||
|
@@ -41,12 +41,14 @@ describe('StaticCallProxy', () => {
|
||||
artifacts.StaticCallProxy,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
staticCallProxy = new IAssetProxyContract(staticCallProxyWithoutTransferFrom.address, provider, txDefaults);
|
||||
staticCallTarget = await TestStaticCallTargetContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestStaticCallTarget,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
});
|
||||
beforeEach(async () => {
|
||||
|
@@ -54,6 +54,7 @@ export class ERC1155ProxyWrapper {
|
||||
erc1155Artifacts.ERC1155Mintable,
|
||||
this._provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
const erc1155Wrapper = new Erc1155Wrapper(erc1155Contract, this._provider, this._contractOwnerAddress);
|
||||
this._dummyTokenWrappers.push(erc1155Wrapper);
|
||||
@@ -69,6 +70,7 @@ export class ERC1155ProxyWrapper {
|
||||
artifacts.ERC1155Proxy,
|
||||
this._provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
||||
return this._proxyContract;
|
||||
|
@@ -37,6 +37,7 @@ export class ERC20Wrapper {
|
||||
erc20Artifacts.DummyERC20Token,
|
||||
this._provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.DUMMY_TOKEN_NAME,
|
||||
constants.DUMMY_TOKEN_SYMBOL,
|
||||
decimals,
|
||||
@@ -51,6 +52,7 @@ export class ERC20Wrapper {
|
||||
artifacts.ERC20Proxy,
|
||||
this._provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
||||
return this._proxyContract;
|
||||
|
@@ -29,6 +29,7 @@ export class ERC721Wrapper {
|
||||
erc721Artifacts.DummyERC721Token,
|
||||
this._provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.DUMMY_TOKEN_NAME,
|
||||
constants.DUMMY_TOKEN_SYMBOL,
|
||||
),
|
||||
@@ -41,6 +42,7 @@ export class ERC721Wrapper {
|
||||
artifacts.ERC721Proxy,
|
||||
this._provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
||||
return this._proxyContract;
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "2.0.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "2.0.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564607468
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "2.0.8",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.11 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.10 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.9 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
||||
## v2.0.8 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-coordinator",
|
||||
"version": "2.0.8",
|
||||
"version": "2.0.11",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,20 +47,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/abi-gen": "^4.1.1",
|
||||
"@0x/contracts-gen": "^1.0.13",
|
||||
"@0x/contracts-test-utils": "^3.1.14",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "*",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -68,17 +69,17 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.3",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-exchange": "^2.1.9",
|
||||
"@0x/contracts-exchange-libs": "^3.0.3",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/base-contract": "^5.3.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.6",
|
||||
"@0x/contracts-erc20": "^2.2.12",
|
||||
"@0x/contracts-exchange": "^2.1.12",
|
||||
"@0x/contracts-exchange-libs": "^3.0.6",
|
||||
"@0x/contracts-utils": "^3.2.2",
|
||||
"@0x/order-utils": "^8.3.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
|
@@ -74,6 +74,7 @@ describe('Coordinator tests', () => {
|
||||
exchangeArtifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||
);
|
||||
|
||||
@@ -91,6 +92,7 @@ describe('Coordinator tests', () => {
|
||||
artifacts.Coordinator,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
exchange.address,
|
||||
);
|
||||
|
||||
|
@@ -25,6 +25,7 @@ describe('Libs tests', () => {
|
||||
artifacts.Coordinator,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
exchangeAddress,
|
||||
);
|
||||
});
|
||||
|
@@ -44,6 +44,7 @@ describe('Mixins tests', () => {
|
||||
artifacts.Coordinator,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
exchangeAddress,
|
||||
);
|
||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||
|
@@ -24,6 +24,7 @@ export class CoordinatorRegistryWrapper {
|
||||
artifacts.CoordinatorRegistry,
|
||||
this._provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
if (this._coordinatorRegistryContract === undefined) {
|
||||
throw new Error(`Failed to deploy Coordinator Registry contract.`);
|
||||
|
@@ -1,4 +1,41 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "0.0.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "0.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1564607468,
|
||||
"version": "0.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564604963
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "0.0.5",
|
||||
|
@@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.0.8 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.7 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.6 - _July 31, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.5 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
||||
## v0.0.5 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-dev-utils",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.8",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,21 +47,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/dev-utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contract-wrappers": "^9.1.8",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/abi-gen": "^4.1.1",
|
||||
"@0x/contracts-gen": "^1.0.13",
|
||||
"@0x/contracts-test-utils": "^3.1.14",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "*",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -69,19 +69,19 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.3",
|
||||
"@0x/contracts-erc1155": "^1.1.10",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-erc721": "^2.1.10",
|
||||
"@0x/contracts-exchange": "^2.1.9",
|
||||
"@0x/contracts-exchange-libs": "^3.0.3",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/base-contract": "^5.3.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.6",
|
||||
"@0x/contracts-erc1155": "^1.1.13",
|
||||
"@0x/contracts-erc20": "^2.2.12",
|
||||
"@0x/contracts-erc721": "^2.1.13",
|
||||
"@0x/contracts-exchange": "^2.1.12",
|
||||
"@0x/contracts-exchange-libs": "^3.0.6",
|
||||
"@0x/contracts-utils": "^3.2.2",
|
||||
"@0x/order-utils": "^8.3.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereumjs-util": "^5.1.1"
|
||||
},
|
||||
|
@@ -92,6 +92,7 @@ describe('LibAssetData', () => {
|
||||
exchangeArtifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.NULL_BYTES,
|
||||
);
|
||||
|
||||
@@ -99,26 +100,31 @@ describe('LibAssetData', () => {
|
||||
proxyArtifacts.ERC20Proxy,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
erc721Proxy = await ERC721ProxyContract.deployFrom0xArtifactAsync(
|
||||
proxyArtifacts.ERC721Proxy,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
erc1155Proxy = await ERC1155ProxyContract.deployFrom0xArtifactAsync(
|
||||
proxyArtifacts.ERC1155Proxy,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
multiAssetProxy = await MultiAssetProxyContract.deployFrom0xArtifactAsync(
|
||||
proxyArtifacts.MultiAssetProxy,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
staticCallProxy = await StaticCallProxyContract.deployFrom0xArtifactAsync(
|
||||
proxyArtifacts.StaticCallProxy,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
|
||||
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(erc20Proxy.address);
|
||||
@@ -131,6 +137,7 @@ describe('LibAssetData', () => {
|
||||
artifacts.LibAssetData,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
exchange.address,
|
||||
);
|
||||
|
||||
@@ -138,6 +145,7 @@ describe('LibAssetData', () => {
|
||||
proxyArtifacts.TestStaticCallTarget,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
|
||||
[tokenOwnerAddress] = await web3Wrapper.getAvailableAddressesAsync();
|
||||
@@ -146,6 +154,7 @@ describe('LibAssetData', () => {
|
||||
erc20Artifacts.DummyERC20Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
'Dummy',
|
||||
'DUM',
|
||||
new BigNumber(1),
|
||||
@@ -156,6 +165,7 @@ describe('LibAssetData', () => {
|
||||
erc721Artifacts.DummyERC721Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
'Dummy',
|
||||
'DUM',
|
||||
);
|
||||
@@ -172,6 +182,7 @@ describe('LibAssetData', () => {
|
||||
erc1155Artifacts.ERC1155Mintable,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
|
||||
const logDecoder = new LogDecoder(web3Wrapper, erc1155Artifacts);
|
||||
|
@@ -37,6 +37,7 @@ describe('LibTransactionDecoder', () => {
|
||||
artifacts.LibTransactionDecoder,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
});
|
||||
after(async () => {
|
||||
|
@@ -83,6 +83,7 @@ describe('OrderValidationUtils', () => {
|
||||
exchangeArtifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
zrxAssetData,
|
||||
);
|
||||
|
||||
@@ -90,6 +91,7 @@ describe('OrderValidationUtils', () => {
|
||||
proxyArtifacts.MultiAssetProxy,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
const exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||
await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner);
|
||||
@@ -102,6 +104,7 @@ describe('OrderValidationUtils', () => {
|
||||
artifacts.DevUtils,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
exchange.address,
|
||||
zrxAssetData,
|
||||
);
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "1.1.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "1.1.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.1.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564604963
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "1.1.10",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.1.13 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.12 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.11 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
||||
## v1.1.10 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc1155",
|
||||
"version": "1.1.10",
|
||||
"version": "1.1.13",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,19 +47,20 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/abi-gen": "^4.1.1",
|
||||
"@0x/contracts-gen": "^1.0.13",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "*",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -67,13 +68,13 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/base-contract": "^5.3.2",
|
||||
"@0x/contracts-test-utils": "^3.1.14",
|
||||
"@0x/contracts-utils": "^3.2.2",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -60,11 +60,13 @@ describe('ERC1155Token', () => {
|
||||
artifacts.ERC1155Mintable,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
erc1155Receiver = await DummyERC1155ReceiverContract.deployFrom0xArtifactAsync(
|
||||
artifacts.DummyERC1155Receiver,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
receiver = erc1155Receiver.address;
|
||||
// create wrapper & mint erc1155 tokens
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "2.2.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "2.2.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.2.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564604963
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "2.2.9",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.2.12 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.11 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.10 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
||||
## v2.2.9 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc20",
|
||||
"version": "2.2.9",
|
||||
"version": "2.2.12",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,20 +47,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/abi-gen": "^4.1.1",
|
||||
"@0x/contracts-gen": "^1.0.13",
|
||||
"@0x/contracts-test-utils": "^3.1.14",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "*",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -68,12 +69,12 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/base-contract": "^5.3.2",
|
||||
"@0x/contracts-utils": "^3.2.2",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -37,6 +37,7 @@ describe('UnlimitedAllowanceToken', () => {
|
||||
artifacts.DummyERC20Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.DUMMY_TOKEN_NAME,
|
||||
constants.DUMMY_TOKEN_SYMBOL,
|
||||
constants.DUMMY_TOKEN_DECIMALS,
|
||||
|
@@ -33,10 +33,15 @@ describe('EtherToken', () => {
|
||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||
account = accounts[0];
|
||||
|
||||
etherToken = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, {
|
||||
gasPrice,
|
||||
...txDefaults,
|
||||
});
|
||||
etherToken = await WETH9Contract.deployFrom0xArtifactAsync(
|
||||
artifacts.WETH9,
|
||||
provider,
|
||||
{
|
||||
gasPrice,
|
||||
...txDefaults,
|
||||
},
|
||||
artifacts,
|
||||
);
|
||||
});
|
||||
beforeEach(async () => {
|
||||
await blockchainLifecycle.startAsync();
|
||||
|
@@ -26,7 +26,12 @@ describe('ZRXToken', () => {
|
||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||
owner = accounts[0];
|
||||
spender = accounts[1];
|
||||
zrxToken = await ZRXTokenContract.deployFrom0xArtifactAsync(artifacts.ZRXToken, provider, txDefaults);
|
||||
zrxToken = await ZRXTokenContract.deployFrom0xArtifactAsync(
|
||||
artifacts.ZRXToken,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
MAX_UINT = constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
|
||||
});
|
||||
beforeEach(async () => {
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "2.1.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "2.1.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564604963
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "2.1.10",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.13 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.12 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.11 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
||||
## v2.1.10 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc721",
|
||||
"version": "2.1.10",
|
||||
"version": "2.1.13",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,20 +47,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/abi-gen": "^4.1.1",
|
||||
"@0x/contracts-gen": "^1.0.13",
|
||||
"@0x/contracts-test-utils": "^3.1.14",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "*",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -68,12 +69,12 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/base-contract": "^5.3.2",
|
||||
"@0x/contracts-utils": "^3.2.2",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -48,6 +48,7 @@ describe('ERC721Token', () => {
|
||||
artifacts.DummyERC721Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.DUMMY_TOKEN_NAME,
|
||||
constants.DUMMY_TOKEN_SYMBOL,
|
||||
);
|
||||
@@ -55,6 +56,7 @@ describe('ERC721Token', () => {
|
||||
artifacts.DummyERC721Receiver,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
logDecoder = new LogDecoder(web3Wrapper, artifacts);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
@@ -176,6 +178,7 @@ describe('ERC721Token', () => {
|
||||
artifacts.DummyERC721Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.DUMMY_TOKEN_NAME,
|
||||
constants.DUMMY_TOKEN_SYMBOL,
|
||||
);
|
||||
@@ -190,6 +193,7 @@ describe('ERC721Token', () => {
|
||||
artifacts.InvalidERC721Receiver,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
const from = owner;
|
||||
const to = invalidErc721Receiver.address;
|
||||
@@ -237,6 +241,7 @@ describe('ERC721Token', () => {
|
||||
artifacts.DummyERC721Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.DUMMY_TOKEN_NAME,
|
||||
constants.DUMMY_TOKEN_SYMBOL,
|
||||
);
|
||||
@@ -251,6 +256,7 @@ describe('ERC721Token', () => {
|
||||
artifacts.InvalidERC721Receiver,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
const from = owner;
|
||||
const to = invalidErc721Receiver.address;
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "3.0.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "3.0.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564607468
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "3.0.7",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.10 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.9 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.8 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
||||
## v3.0.7 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-forwarder",
|
||||
"version": "3.0.7",
|
||||
"version": "3.0.10",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -46,21 +46,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contract-wrappers": "^9.1.8",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/abi-gen": "^4.1.1",
|
||||
"@0x/contracts-gen": "^1.0.13",
|
||||
"@0x/contracts-test-utils": "^3.1.14",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "*",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -68,18 +68,18 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.3",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-erc721": "^2.1.10",
|
||||
"@0x/contracts-exchange": "^2.1.9",
|
||||
"@0x/contracts-exchange-libs": "^3.0.3",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/base-contract": "^5.3.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.6",
|
||||
"@0x/contracts-erc20": "^2.2.12",
|
||||
"@0x/contracts-erc721": "^2.1.13",
|
||||
"@0x/contracts-exchange": "^2.1.12",
|
||||
"@0x/contracts-exchange-libs": "^3.0.6",
|
||||
"@0x/contracts-utils": "^3.2.2",
|
||||
"@0x/order-utils": "^8.3.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -32,6 +32,7 @@ const DECIMALS_DEFAULT = 18;
|
||||
const MAX_WETH_FILL_PERCENTAGE = 95;
|
||||
|
||||
describe(ContractName.Forwarder, () => {
|
||||
const dependencyArtifacts = { ...artifacts, ...erc20Artifacts, ...exchangeArtifacts };
|
||||
let makerAddress: string;
|
||||
let owner: string;
|
||||
let takerAddress: string;
|
||||
@@ -88,7 +89,12 @@ describe(ContractName.Forwarder, () => {
|
||||
const erc721Balances = await erc721Wrapper.getBalancesAsync();
|
||||
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
|
||||
|
||||
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(erc20Artifacts.WETH9, provider, txDefaults);
|
||||
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(
|
||||
erc20Artifacts.WETH9,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
);
|
||||
weth = new DummyERC20TokenContract(wethContract.address, provider);
|
||||
erc20Wrapper.addDummyTokenContract(weth);
|
||||
|
||||
@@ -98,6 +104,7 @@ describe(ContractName.Forwarder, () => {
|
||||
exchangeArtifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
zrxAssetData,
|
||||
);
|
||||
exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
||||
@@ -131,6 +138,7 @@ describe(ContractName.Forwarder, () => {
|
||||
artifacts.Forwarder,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
exchangeInstance.address,
|
||||
zrxAssetData,
|
||||
wethAssetData,
|
||||
@@ -169,6 +177,7 @@ describe(ContractName.Forwarder, () => {
|
||||
exchangeArtifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
zrxAssetData,
|
||||
);
|
||||
return expectContractCreationFailedAsync(
|
||||
@@ -176,6 +185,7 @@ describe(ContractName.Forwarder, () => {
|
||||
artifacts.Forwarder,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
exchangeInstance.address,
|
||||
zrxAssetData,
|
||||
wethAssetData,
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "3.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "3.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564604963
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "3.0.3",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.6 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.5 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.4 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
||||
## v3.0.3 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-libs",
|
||||
"version": "3.0.3",
|
||||
"version": "3.0.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,20 +47,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/libs/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/abi-gen": "^4.1.1",
|
||||
"@0x/contracts-gen": "^1.0.13",
|
||||
"@0x/contracts-test-utils": "^3.1.14",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "*",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -68,13 +69,13 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/base-contract": "^5.3.2",
|
||||
"@0x/contracts-utils": "^3.2.2",
|
||||
"@0x/order-utils": "^8.3.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -35,7 +35,7 @@ describe('Exchange libs', () => {
|
||||
before(async () => {
|
||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||
const makerAddress = accounts[0];
|
||||
libs = await TestLibsContract.deployFrom0xArtifactAsync(artifacts.TestLibs, provider, txDefaults);
|
||||
libs = await TestLibsContract.deployFrom0xArtifactAsync(artifacts.TestLibs, provider, txDefaults, artifacts);
|
||||
|
||||
const defaultOrderParams = {
|
||||
...constants.STATIC_ORDER_PARAMS,
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "2.1.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "2.1.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564607468
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "2.1.9",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.12 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.11 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.10 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
||||
## v2.1.9 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -21,7 +21,7 @@ pragma solidity ^0.5.5;
|
||||
import "../src/interfaces/IValidator.sol";
|
||||
|
||||
|
||||
contract Validator is
|
||||
contract Validator is
|
||||
IValidator
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ contract Validator is
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param signerAddress Address that should have signed the given hash.
|
||||
/// @param signature Proof of signing.
|
||||
/// @return Validity of signature.
|
||||
/// @return Returns a known magic value if the signature is valid.
|
||||
// solhint-disable no-unused-vars
|
||||
function isValidSignature(
|
||||
bytes32 hash,
|
||||
@@ -48,9 +48,11 @@ contract Validator is
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid)
|
||||
returns (bytes4)
|
||||
{
|
||||
return (signerAddress == VALID_SIGNER);
|
||||
require(signerAddress == VALID_SIGNER, "INVALID_SIGNER");
|
||||
bytes4 magicValue = bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"));
|
||||
return magicValue;
|
||||
}
|
||||
// solhint-enable no-unused-vars
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ import "../src/interfaces/IWallet.sol";
|
||||
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||
|
||||
|
||||
contract Wallet is
|
||||
contract Wallet is
|
||||
IWallet
|
||||
{
|
||||
using LibBytes for bytes;
|
||||
@@ -41,14 +41,14 @@ contract Wallet is
|
||||
/// The signer must match the owner of this wallet.
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param eip712Signature Proof of signing.
|
||||
/// @return Validity of signature.
|
||||
/// @return Returns a known magic value if the signature is valid.
|
||||
function isValidSignature(
|
||||
bytes32 hash,
|
||||
bytes calldata eip712Signature
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid)
|
||||
returns (bytes4)
|
||||
{
|
||||
require(
|
||||
eip712Signature.length == 65,
|
||||
@@ -59,7 +59,8 @@ contract Wallet is
|
||||
bytes32 r = eip712Signature.readBytes32(1);
|
||||
bytes32 s = eip712Signature.readBytes32(33);
|
||||
address recoveredAddress = ecrecover(hash, v, r, s);
|
||||
isValid = WALLET_OWNER == recoveredAddress;
|
||||
return isValid;
|
||||
require(WALLET_OWNER == recoveredAddress, "INVALID_SIGNATURE");
|
||||
bytes4 magicValue = bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"));
|
||||
return magicValue;
|
||||
}
|
||||
}
|
||||
|
@@ -73,10 +73,12 @@ contract Whitelist is
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid)
|
||||
returns (bytes4)
|
||||
{
|
||||
// solhint-disable-next-line avoid-tx-origin
|
||||
return signerAddress == tx.origin;
|
||||
require(signerAddress == tx.origin, "INVALID_SIGNER");
|
||||
bytes4 magicValue = bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"));
|
||||
return magicValue;
|
||||
}
|
||||
// solhint-enable no-unused-vars
|
||||
|
||||
|
@@ -32,7 +32,7 @@ contract MixinSignatureValidator is
|
||||
MTransactions
|
||||
{
|
||||
using LibBytes for bytes;
|
||||
|
||||
|
||||
// Mapping of hash => signer => signed
|
||||
mapping (bytes32 => mapping (address => bool)) public preSigned;
|
||||
|
||||
@@ -197,7 +197,7 @@ contract MixinSignatureValidator is
|
||||
} else if (signatureType == SignatureType.Validator) {
|
||||
// Pop last 20 bytes off of signature byte array.
|
||||
address validatorAddress = signature.popLast20Bytes();
|
||||
|
||||
|
||||
// Ensure signer has approved validator.
|
||||
if (!allowedValidators[signerAddress][validatorAddress]) {
|
||||
return false;
|
||||
@@ -224,7 +224,8 @@ contract MixinSignatureValidator is
|
||||
revert("SIGNATURE_UNSUPPORTED");
|
||||
}
|
||||
|
||||
/// @dev Verifies signature using logic defined by Wallet contract.
|
||||
/// @dev Verifies signature using logic defined by Wallet contract. Wallet contract
|
||||
/// must return `bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"))`
|
||||
/// @param hash Any 32 byte hash.
|
||||
/// @param walletAddress Address that should have signed the given hash
|
||||
/// and defines its own signature verification method.
|
||||
@@ -244,7 +245,19 @@ contract MixinSignatureValidator is
|
||||
hash,
|
||||
signature
|
||||
);
|
||||
// bytes4 0xb0671381
|
||||
bytes32 magicValue = bytes32(bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)")));
|
||||
assembly {
|
||||
// extcodesize added as an extra safety measure
|
||||
if iszero(extcodesize(walletAddress)) {
|
||||
// Revert with `Error("WALLET_ERROR")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
let cdStart := add(callData, 32)
|
||||
let success := staticcall(
|
||||
gas, // forward all gas
|
||||
@@ -255,6 +268,15 @@ contract MixinSignatureValidator is
|
||||
32 // output size is 32 bytes
|
||||
)
|
||||
|
||||
if iszero(eq(returndatasize(), 32)) {
|
||||
// Revert with `Error("WALLET_ERROR")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
switch success
|
||||
case 0 {
|
||||
// Revert with `Error("WALLET_ERROR")`
|
||||
@@ -266,13 +288,17 @@ contract MixinSignatureValidator is
|
||||
}
|
||||
case 1 {
|
||||
// Signature is valid if call did not revert and returned true
|
||||
isValid := mload(cdStart)
|
||||
isValid := eq(
|
||||
and(mload(cdStart), 0xffffffff00000000000000000000000000000000000000000000000000000000),
|
||||
and(magicValue, 0xffffffff00000000000000000000000000000000000000000000000000000000)
|
||||
)
|
||||
}
|
||||
}
|
||||
return isValid;
|
||||
}
|
||||
|
||||
/// @dev Verifies signature using logic defined by Validator contract.
|
||||
/// Validator must return `bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"))`
|
||||
/// @param validatorAddress Address of validator contract.
|
||||
/// @param hash Any 32 byte hash.
|
||||
/// @param signerAddress Address that should have signed the given hash.
|
||||
@@ -294,7 +320,19 @@ contract MixinSignatureValidator is
|
||||
signerAddress,
|
||||
signature
|
||||
);
|
||||
// bytes4 0x42b38674
|
||||
bytes32 magicValue = bytes32(bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)")));
|
||||
assembly {
|
||||
// extcodesize added as an extra safety measure
|
||||
if iszero(extcodesize(validatorAddress)) {
|
||||
// Revert with `Error("VALIDATOR_ERROR")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
let cdStart := add(callData, 32)
|
||||
let success := staticcall(
|
||||
gas, // forward all gas
|
||||
@@ -305,6 +343,15 @@ contract MixinSignatureValidator is
|
||||
32 // output size is 32 bytes
|
||||
)
|
||||
|
||||
if iszero(eq(returndatasize(), 32)) {
|
||||
// Revert with `Error("VALIDATOR_ERROR")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
switch success
|
||||
case 0 {
|
||||
// Revert with `Error("VALIDATOR_ERROR")`
|
||||
@@ -316,7 +363,10 @@ contract MixinSignatureValidator is
|
||||
}
|
||||
case 1 {
|
||||
// Signature is valid if call did not revert and returned true
|
||||
isValid := mload(cdStart)
|
||||
isValid := eq(
|
||||
and(mload(cdStart), 0xffffffff00000000000000000000000000000000000000000000000000000000),
|
||||
and(magicValue, 0xffffffff00000000000000000000000000000000000000000000000000000000)
|
||||
)
|
||||
}
|
||||
}
|
||||
return isValid;
|
||||
|
@@ -25,7 +25,8 @@ contract IValidator {
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param signerAddress Address that should have signed the given hash.
|
||||
/// @param signature Proof of signing.
|
||||
/// @return Validity of order signature.
|
||||
/// @return Magic bytes4 value if the signature is valid.
|
||||
/// Magic value is bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"))
|
||||
function isValidSignature(
|
||||
bytes32 hash,
|
||||
address signerAddress,
|
||||
@@ -33,5 +34,5 @@ contract IValidator {
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid);
|
||||
returns (bytes4);
|
||||
}
|
||||
|
@@ -24,12 +24,13 @@ contract IWallet {
|
||||
/// @dev Verifies that a signature is valid.
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param signature Proof of signing.
|
||||
/// @return Validity of order signature.
|
||||
/// @return Magic bytes4 value if the signature is valid.
|
||||
/// Magic value is bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"))
|
||||
function isValidSignature(
|
||||
bytes32 hash,
|
||||
bytes calldata signature
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid);
|
||||
returns (bytes4);
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange",
|
||||
"version": "2.1.9",
|
||||
"version": "2.1.12",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,20 +47,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/abi-gen": "^4.1.1",
|
||||
"@0x/contracts-gen": "^1.0.13",
|
||||
"@0x/contracts-test-utils": "^3.1.14",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "*",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -68,18 +69,18 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.3",
|
||||
"@0x/contracts-erc1155": "^1.1.10",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-erc721": "^2.1.10",
|
||||
"@0x/contracts-exchange-libs": "^3.0.3",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/base-contract": "^5.3.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.6",
|
||||
"@0x/contracts-erc1155": "^1.1.13",
|
||||
"@0x/contracts-erc20": "^2.2.12",
|
||||
"@0x/contracts-erc721": "^2.1.13",
|
||||
"@0x/contracts-exchange-libs": "^3.0.6",
|
||||
"@0x/contracts-utils": "^3.2.2",
|
||||
"@0x/order-utils": "^8.3.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
artifacts as proxyArtifacts,
|
||||
ERC1155ProxyContract,
|
||||
ERC1155ProxyWrapper,
|
||||
ERC20ProxyContract,
|
||||
ERC20Wrapper,
|
||||
@@ -50,6 +51,8 @@ import {
|
||||
TestStaticCallReceiverContract,
|
||||
} from '../src';
|
||||
|
||||
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
@@ -69,7 +72,7 @@ describe('Exchange core', () => {
|
||||
let exchange: ExchangeContract;
|
||||
let erc20Proxy: ERC20ProxyContract;
|
||||
let erc721Proxy: ERC721ProxyContract;
|
||||
let erc1155Proxy: ERC721ProxyContract;
|
||||
let erc1155Proxy: ERC1155ProxyContract;
|
||||
let multiAssetProxy: MultiAssetProxyContract;
|
||||
let staticCallProxy: StaticCallProxyContract;
|
||||
let staticCallTarget: TestStaticCallTargetContract;
|
||||
@@ -116,11 +119,13 @@ describe('Exchange core', () => {
|
||||
proxyArtifacts.MultiAssetProxy,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
);
|
||||
staticCallProxy = await StaticCallProxyContract.deployFrom0xArtifactAsync(
|
||||
proxyArtifacts.StaticCallProxy,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
);
|
||||
const numDummyErc20ToDeploy = 3;
|
||||
[erc20TokenA, erc20TokenB, zrxToken] = await erc20Wrapper.deployDummyTokensAsync(
|
||||
@@ -135,17 +140,20 @@ describe('Exchange core', () => {
|
||||
artifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||
);
|
||||
maliciousWallet = maliciousValidator = await TestStaticCallReceiverContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestStaticCallReceiver,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
);
|
||||
reentrantErc20Token = await ReentrantERC20TokenContract.deployFrom0xArtifactAsync(
|
||||
artifacts.ReentrantERC20Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
exchange.address,
|
||||
);
|
||||
|
||||
@@ -348,6 +356,7 @@ describe('Exchange core', () => {
|
||||
erc20Artifacts.DummyNoReturnERC20Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
constants.DUMMY_TOKEN_NAME,
|
||||
constants.DUMMY_TOKEN_SYMBOL,
|
||||
constants.DUMMY_TOKEN_DECIMALS,
|
||||
@@ -1473,6 +1482,7 @@ describe('Exchange core', () => {
|
||||
proxyArtifacts.TestStaticCallTarget,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
);
|
||||
});
|
||||
it('should revert if the staticcall is unsuccessful', async () => {
|
||||
|
@@ -29,6 +29,8 @@ import {
|
||||
TestAssetProxyDispatcherContract,
|
||||
} from '../src';
|
||||
|
||||
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
@@ -72,6 +74,7 @@ describe('AssetProxyDispatcher', () => {
|
||||
artifacts.TestAssetProxyDispatcher,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(assetProxyDispatcher.address, {
|
||||
@@ -134,6 +137,7 @@ describe('AssetProxyDispatcher', () => {
|
||||
proxyArtifacts.ERC20Proxy,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
);
|
||||
// Register new ERC20 Transfer Proxy contract
|
||||
return expectTransactionFailedAsync(
|
||||
|
@@ -18,6 +18,8 @@ import * as _ from 'lodash';
|
||||
|
||||
import { artifacts, TestExchangeInternalsContract } from '../src';
|
||||
|
||||
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
|
||||
@@ -65,6 +67,7 @@ describe('Exchange core internal functions', () => {
|
||||
artifacts.TestExchangeInternals,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
);
|
||||
overflowErrorForSendTransaction = new Error(
|
||||
await getRevertReasonOrErrorMessageForSendTransactionAsync(RevertReason.Uint256Overflow),
|
||||
|
@@ -29,6 +29,8 @@ import {
|
||||
TestExchangeInternalsContract,
|
||||
} from '../src';
|
||||
|
||||
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
@@ -118,6 +120,7 @@ describe('matchOrders', () => {
|
||||
artifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||
);
|
||||
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||
@@ -141,6 +144,7 @@ describe('matchOrders', () => {
|
||||
artifacts.ReentrantERC20Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
exchange.address,
|
||||
);
|
||||
|
||||
@@ -175,6 +179,7 @@ describe('matchOrders', () => {
|
||||
artifacts.TestExchangeInternals,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
);
|
||||
});
|
||||
beforeEach(async () => {
|
||||
|
@@ -25,6 +25,8 @@ import {
|
||||
WalletContract,
|
||||
} from '../src';
|
||||
|
||||
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
|
||||
@@ -59,23 +61,27 @@ describe('MixinSignatureValidator', () => {
|
||||
artifacts.TestSignatureValidator,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
);
|
||||
testWallet = await WalletContract.deployFrom0xArtifactAsync(
|
||||
artifacts.Wallet,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
signerAddress,
|
||||
);
|
||||
testValidator = await ValidatorContract.deployFrom0xArtifactAsync(
|
||||
artifacts.Validator,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
signerAddress,
|
||||
);
|
||||
maliciousWallet = maliciousValidator = await TestStaticCallReceiverContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestStaticCallReceiver,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
);
|
||||
signatureValidatorLogDecoder = new LogDecoder(web3Wrapper, artifacts);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
@@ -94,6 +100,12 @@ describe('MixinSignatureValidator', () => {
|
||||
),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await signatureValidator.setSignatureValidatorApproval.sendTransactionAsync(testValidator.address, true, {
|
||||
from: notSignerAddress,
|
||||
}),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
|
||||
const defaultOrderParams = {
|
||||
...constants.STATIC_ORDER_PARAMS,
|
||||
@@ -301,7 +313,7 @@ describe('MixinSignatureValidator', () => {
|
||||
expect(isValidSignature).to.be.true();
|
||||
});
|
||||
|
||||
it('should return false when SignatureType=Wallet and signature is invalid', async () => {
|
||||
it('should revert when SignatureType=Wallet and signature is invalid', async () => {
|
||||
// Create EIP712 signature using a private key that does not belong to the wallet owner.
|
||||
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const orderHashBuffer = ethUtil.toBuffer(orderHashHex);
|
||||
@@ -316,12 +328,10 @@ describe('MixinSignatureValidator', () => {
|
||||
]);
|
||||
const signatureHex = ethUtil.bufferToHex(signature);
|
||||
// Validate signature
|
||||
const isValidSignature = await signatureValidator.publicIsValidSignature.callAsync(
|
||||
orderHashHex,
|
||||
testWallet.address,
|
||||
signatureHex,
|
||||
return expectContractCallFailedAsync(
|
||||
signatureValidator.publicIsValidSignature.callAsync(orderHashHex, testWallet.address, signatureHex),
|
||||
RevertReason.WalletError,
|
||||
);
|
||||
expect(isValidSignature).to.be.false();
|
||||
});
|
||||
|
||||
it('should revert when `isValidSignature` attempts to update state and SignatureType=Wallet', async () => {
|
||||
@@ -359,6 +369,15 @@ describe('MixinSignatureValidator', () => {
|
||||
signatureHex,
|
||||
);
|
||||
expect(isValidSignature).to.be.true();
|
||||
|
||||
const isValidSignatureTs = await signatureUtils.isValidSignatureAsync(
|
||||
provider,
|
||||
orderHashHex,
|
||||
signatureHex,
|
||||
signerAddress,
|
||||
signatureValidator.address,
|
||||
);
|
||||
expect(isValidSignatureTs).to.be.true();
|
||||
});
|
||||
|
||||
it('should return false when SignatureType=Validator, signature is invalid and validator is approved', async () => {
|
||||
@@ -369,12 +388,19 @@ describe('MixinSignatureValidator', () => {
|
||||
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
// This will return false because we signed the message with `signerAddress`, but
|
||||
// are validating against `notSignerAddress`
|
||||
const isValidSignature = await signatureValidator.publicIsValidSignature.callAsync(
|
||||
orderHashHex,
|
||||
notSignerAddress,
|
||||
signatureHex,
|
||||
await expectContractCallFailedAsync(
|
||||
signatureValidator.publicIsValidSignature.callAsync(orderHashHex, notSignerAddress, signatureHex),
|
||||
RevertReason.ValidatorError,
|
||||
);
|
||||
expect(isValidSignature).to.be.false();
|
||||
|
||||
const isValidSignatureTs = await signatureUtils.isValidSignatureAsync(
|
||||
provider,
|
||||
orderHashHex,
|
||||
signatureHex,
|
||||
notSignerAddress,
|
||||
signatureValidator.address,
|
||||
);
|
||||
expect(isValidSignatureTs).to.be.false();
|
||||
});
|
||||
|
||||
it('should revert when `isValidSignature` attempts to update state and SignatureType=Validator', async () => {
|
||||
@@ -410,6 +436,16 @@ describe('MixinSignatureValidator', () => {
|
||||
signatureHex,
|
||||
);
|
||||
expect(isValidSignature).to.be.false();
|
||||
|
||||
expect(
|
||||
signatureUtils.isValidSignatureAsync(
|
||||
provider,
|
||||
orderHashHex,
|
||||
signatureHex,
|
||||
signerAddress,
|
||||
signatureValidator.address,
|
||||
),
|
||||
).to.be.rejected();
|
||||
});
|
||||
|
||||
it('should return true when SignatureType=Presigned and signer has presigned hash', async () => {
|
||||
|
@@ -21,6 +21,8 @@ import * as _ from 'lodash';
|
||||
|
||||
import { artifacts, ExchangeContract, ExchangeWrapper, ExchangeWrapperContract, WhitelistContract } from '../src/';
|
||||
|
||||
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
@@ -87,6 +89,7 @@ describe('Exchange transactions', () => {
|
||||
artifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||
);
|
||||
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||
@@ -219,6 +222,7 @@ describe('Exchange transactions', () => {
|
||||
artifacts.ExchangeWrapper,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
exchange.address,
|
||||
);
|
||||
});
|
||||
@@ -333,6 +337,7 @@ describe('Exchange transactions', () => {
|
||||
artifacts.Whitelist,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
exchange.address,
|
||||
);
|
||||
const isApproved = true;
|
||||
|
9
contracts/exchange/test/utils/dependency_artifacts.ts
Normal file
9
contracts/exchange/test/utils/dependency_artifacts.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { artifacts as erc1155Artifacts } from '@0x/contracts-erc1155';
|
||||
import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
|
||||
import { artifacts as erc721Artifacts } from '@0x/contracts-erc721';
|
||||
|
||||
export const dependencyArtifacts = {
|
||||
...erc20Artifacts,
|
||||
...erc721Artifacts,
|
||||
...erc1155Artifacts,
|
||||
};
|
@@ -1,37 +1,21 @@
|
||||
import { artifacts as erc1155Artifacts } from '@0x/contracts-erc1155';
|
||||
import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
|
||||
import { artifacts as erc721Artifacts } from '@0x/contracts-erc721';
|
||||
import {
|
||||
FillResults,
|
||||
formatters,
|
||||
LogDecoder,
|
||||
OrderInfo,
|
||||
orderUtils,
|
||||
Web3ProviderEngine,
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { FillResults, formatters, OrderInfo, orderUtils, Web3ProviderEngine } from '@0x/contracts-test-utils';
|
||||
import { SignedOrder, SignedZeroExTransaction } from '@0x/types';
|
||||
import { AbiEncoder, BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { MethodAbi, TransactionReceiptWithDecodedLogs, ZeroExProvider } from 'ethereum-types';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { artifacts, ExchangeContract } from '../../src';
|
||||
import { ExchangeContract } from '../../src';
|
||||
|
||||
import { AbiDecodedFillOrderData } from './types';
|
||||
|
||||
export class ExchangeWrapper {
|
||||
private readonly _exchange: ExchangeContract;
|
||||
// tslint:disable no-unused-variable
|
||||
private readonly _web3Wrapper: Web3Wrapper;
|
||||
private readonly _logDecoder: LogDecoder;
|
||||
constructor(exchangeContract: ExchangeContract, provider: Web3ProviderEngine | ZeroExProvider) {
|
||||
this._exchange = exchangeContract;
|
||||
this._web3Wrapper = new Web3Wrapper(provider);
|
||||
this._logDecoder = new LogDecoder(this._web3Wrapper, {
|
||||
...artifacts,
|
||||
...erc20Artifacts,
|
||||
...erc721Artifacts,
|
||||
...erc1155Artifacts,
|
||||
});
|
||||
}
|
||||
public async fillOrderAsync(
|
||||
signedOrder: SignedOrder,
|
||||
@@ -39,20 +23,18 @@ export class ExchangeWrapper {
|
||||
opts: { takerAssetFillAmount?: BigNumber } = {},
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
||||
const txHash = await this._exchange.fillOrder.sendTransactionAsync(
|
||||
const txReceipt = await this._exchange.fillOrder.awaitTransactionSuccessAsync(
|
||||
params.order,
|
||||
params.takerAssetFillAmount,
|
||||
params.signature,
|
||||
{ from },
|
||||
);
|
||||
const txReceipt = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return txReceipt;
|
||||
}
|
||||
public async cancelOrderAsync(signedOrder: SignedOrder, from: string): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = orderUtils.createCancel(signedOrder);
|
||||
const txHash = await this._exchange.cancelOrder.sendTransactionAsync(params.order, { from });
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
const txReceipt = await this._exchange.cancelOrder.awaitTransactionSuccessAsync(params.order, { from });
|
||||
return txReceipt;
|
||||
}
|
||||
public async fillOrKillOrderAsync(
|
||||
signedOrder: SignedOrder,
|
||||
@@ -60,14 +42,13 @@ export class ExchangeWrapper {
|
||||
opts: { takerAssetFillAmount?: BigNumber } = {},
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
||||
const txHash = await this._exchange.fillOrKillOrder.sendTransactionAsync(
|
||||
const txReceipt = await this._exchange.fillOrKillOrder.awaitTransactionSuccessAsync(
|
||||
params.order,
|
||||
params.takerAssetFillAmount,
|
||||
params.signature,
|
||||
{ from },
|
||||
);
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
return txReceipt;
|
||||
}
|
||||
public async fillOrderNoThrowAsync(
|
||||
signedOrder: SignedOrder,
|
||||
@@ -75,14 +56,13 @@ export class ExchangeWrapper {
|
||||
opts: { takerAssetFillAmount?: BigNumber; gas?: number } = {},
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
||||
const txHash = await this._exchange.fillOrderNoThrow.sendTransactionAsync(
|
||||
const txReceipt = await this._exchange.fillOrderNoThrow.awaitTransactionSuccessAsync(
|
||||
params.order,
|
||||
params.takerAssetFillAmount,
|
||||
params.signature,
|
||||
{ from, gas: opts.gas },
|
||||
);
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
return txReceipt;
|
||||
}
|
||||
public async batchFillOrdersAsync(
|
||||
orders: SignedOrder[],
|
||||
@@ -90,14 +70,13 @@ export class ExchangeWrapper {
|
||||
opts: { takerAssetFillAmounts?: BigNumber[] } = {},
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
||||
const txHash = await this._exchange.batchFillOrders.sendTransactionAsync(
|
||||
const txReceipt = await this._exchange.batchFillOrders.awaitTransactionSuccessAsync(
|
||||
params.orders,
|
||||
params.takerAssetFillAmounts,
|
||||
params.signatures,
|
||||
{ from },
|
||||
);
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
return txReceipt;
|
||||
}
|
||||
public async batchFillOrKillOrdersAsync(
|
||||
orders: SignedOrder[],
|
||||
@@ -105,14 +84,13 @@ export class ExchangeWrapper {
|
||||
opts: { takerAssetFillAmounts?: BigNumber[] } = {},
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
||||
const txHash = await this._exchange.batchFillOrKillOrders.sendTransactionAsync(
|
||||
const txReceipt = await this._exchange.batchFillOrKillOrders.awaitTransactionSuccessAsync(
|
||||
params.orders,
|
||||
params.takerAssetFillAmounts,
|
||||
params.signatures,
|
||||
{ from },
|
||||
);
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
return txReceipt;
|
||||
}
|
||||
public async batchFillOrdersNoThrowAsync(
|
||||
orders: SignedOrder[],
|
||||
@@ -120,14 +98,13 @@ export class ExchangeWrapper {
|
||||
opts: { takerAssetFillAmounts?: BigNumber[]; gas?: number } = {},
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
||||
const txHash = await this._exchange.batchFillOrdersNoThrow.sendTransactionAsync(
|
||||
const txReceipt = await this._exchange.batchFillOrdersNoThrow.awaitTransactionSuccessAsync(
|
||||
params.orders,
|
||||
params.takerAssetFillAmounts,
|
||||
params.signatures,
|
||||
{ from, gas: opts.gas },
|
||||
);
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
return txReceipt;
|
||||
}
|
||||
public async marketSellOrdersAsync(
|
||||
orders: SignedOrder[],
|
||||
@@ -135,14 +112,13 @@ export class ExchangeWrapper {
|
||||
opts: { takerAssetFillAmount: BigNumber },
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount);
|
||||
const txHash = await this._exchange.marketSellOrders.sendTransactionAsync(
|
||||
const txReceipt = await this._exchange.marketSellOrders.awaitTransactionSuccessAsync(
|
||||
params.orders,
|
||||
params.takerAssetFillAmount,
|
||||
params.signatures,
|
||||
{ from },
|
||||
);
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
return txReceipt;
|
||||
}
|
||||
public async marketSellOrdersNoThrowAsync(
|
||||
orders: SignedOrder[],
|
||||
@@ -150,14 +126,13 @@ export class ExchangeWrapper {
|
||||
opts: { takerAssetFillAmount: BigNumber; gas?: number },
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount);
|
||||
const txHash = await this._exchange.marketSellOrdersNoThrow.sendTransactionAsync(
|
||||
const txReceipt = await this._exchange.marketSellOrdersNoThrow.awaitTransactionSuccessAsync(
|
||||
params.orders,
|
||||
params.takerAssetFillAmount,
|
||||
params.signatures,
|
||||
{ from, gas: opts.gas },
|
||||
);
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
return txReceipt;
|
||||
}
|
||||
public async marketBuyOrdersAsync(
|
||||
orders: SignedOrder[],
|
||||
@@ -165,14 +140,13 @@ export class ExchangeWrapper {
|
||||
opts: { makerAssetFillAmount: BigNumber },
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount);
|
||||
const txHash = await this._exchange.marketBuyOrders.sendTransactionAsync(
|
||||
const txReceipt = await this._exchange.marketBuyOrders.awaitTransactionSuccessAsync(
|
||||
params.orders,
|
||||
params.makerAssetFillAmount,
|
||||
params.signatures,
|
||||
{ from },
|
||||
);
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
return txReceipt;
|
||||
}
|
||||
public async marketBuyOrdersNoThrowAsync(
|
||||
orders: SignedOrder[],
|
||||
@@ -180,50 +154,47 @@ export class ExchangeWrapper {
|
||||
opts: { makerAssetFillAmount: BigNumber; gas?: number },
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount);
|
||||
const txHash = await this._exchange.marketBuyOrdersNoThrow.sendTransactionAsync(
|
||||
const txReceipt = await this._exchange.marketBuyOrdersNoThrow.awaitTransactionSuccessAsync(
|
||||
params.orders,
|
||||
params.makerAssetFillAmount,
|
||||
params.signatures,
|
||||
{ from, gas: opts.gas },
|
||||
);
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
return txReceipt;
|
||||
}
|
||||
public async batchCancelOrdersAsync(
|
||||
orders: SignedOrder[],
|
||||
from: string,
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = formatters.createBatchCancel(orders);
|
||||
const txHash = await this._exchange.batchCancelOrders.sendTransactionAsync(params.orders, { from });
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
const txReceipt = await this._exchange.batchCancelOrders.awaitTransactionSuccessAsync(params.orders, { from });
|
||||
return txReceipt;
|
||||
}
|
||||
public async cancelOrdersUpToAsync(salt: BigNumber, from: string): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const txHash = await this._exchange.cancelOrdersUpTo.sendTransactionAsync(salt, { from });
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
const txReceipt = await this._exchange.cancelOrdersUpTo.awaitTransactionSuccessAsync(salt, { from });
|
||||
return txReceipt;
|
||||
}
|
||||
public async registerAssetProxyAsync(
|
||||
assetProxyAddress: string,
|
||||
from: string,
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const txHash = await this._exchange.registerAssetProxy.sendTransactionAsync(assetProxyAddress, { from });
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
const txReceipt = await this._exchange.registerAssetProxy.awaitTransactionSuccessAsync(assetProxyAddress, {
|
||||
from,
|
||||
});
|
||||
return txReceipt;
|
||||
}
|
||||
public async executeTransactionAsync(
|
||||
signedTx: SignedZeroExTransaction,
|
||||
from: string,
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const txHash = await this._exchange.executeTransaction.sendTransactionAsync(
|
||||
const txReceipt = await this._exchange.executeTransaction.awaitTransactionSuccessAsync(
|
||||
signedTx.salt,
|
||||
signedTx.signerAddress,
|
||||
signedTx.data,
|
||||
signedTx.signature,
|
||||
{ from },
|
||||
);
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
return txReceipt;
|
||||
}
|
||||
public async getTakerAssetFilledAmountAsync(orderHashHex: string): Promise<BigNumber> {
|
||||
const filledAmount = await this._exchange.filled.callAsync(orderHashHex);
|
||||
@@ -251,15 +222,14 @@ export class ExchangeWrapper {
|
||||
from: string,
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const params = orderUtils.createMatchOrders(signedOrderLeft, signedOrderRight);
|
||||
const txHash = await this._exchange.matchOrders.sendTransactionAsync(
|
||||
const txReceipt = await this._exchange.matchOrders.awaitTransactionSuccessAsync(
|
||||
params.left,
|
||||
params.right,
|
||||
params.leftSignature,
|
||||
params.rightSignature,
|
||||
{ from },
|
||||
);
|
||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
||||
return tx;
|
||||
return txReceipt;
|
||||
}
|
||||
public async getFillOrderResultsAsync(
|
||||
signedOrder: SignedOrder,
|
||||
|
@@ -37,6 +37,7 @@ import 'make-promises-safe';
|
||||
import { artifacts, ExchangeContract, ExchangeFillEventArgs } from '../../src';
|
||||
|
||||
import { AssetWrapper } from './asset_wrapper';
|
||||
import { dependencyArtifacts } from './dependency_artifacts';
|
||||
import { ExchangeWrapper } from './exchange_wrapper';
|
||||
import { OrderFactoryFromScenario } from './order_factory_from_scenario';
|
||||
import { SimpleAssetBalanceAndProxyAllowanceFetcher } from './simple_asset_balance_and_proxy_allowance_fetcher';
|
||||
@@ -101,6 +102,7 @@ export async function fillOrderCombinatorialUtilsFactoryAsync(
|
||||
artifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
zrxAssetData,
|
||||
);
|
||||
const exchangeWrapper = new ExchangeWrapper(exchangeContract, provider);
|
||||
@@ -135,6 +137,7 @@ export async function fillOrderCombinatorialUtilsFactoryAsync(
|
||||
libsArtifacts.TestLibs,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
);
|
||||
|
||||
const fillOrderCombinatorialUtils = new FillOrderCombinatorialUtils(
|
||||
|
@@ -24,6 +24,8 @@ import * as _ from 'lodash';
|
||||
|
||||
import { artifacts, ExchangeContract, ExchangeWrapper, ReentrantERC20TokenContract } from '../src';
|
||||
|
||||
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
@@ -87,6 +89,7 @@ describe('Exchange wrappers', () => {
|
||||
artifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||
);
|
||||
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||
@@ -110,6 +113,7 @@ describe('Exchange wrappers', () => {
|
||||
artifacts.ReentrantERC20Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
dependencyArtifacts,
|
||||
exchange.address,
|
||||
);
|
||||
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "4.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "4.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564607468
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "4.0.3",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.0.6 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.5 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.4 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
||||
## v4.0.3 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-extensions",
|
||||
"version": "4.0.3",
|
||||
"version": "4.0.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,21 +47,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contract-wrappers": "^9.1.8",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/abi-gen": "^4.1.1",
|
||||
"@0x/contracts-gen": "^1.0.13",
|
||||
"@0x/contracts-test-utils": "^3.1.14",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "*",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -69,18 +69,18 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.3",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/contracts-erc721": "^2.1.10",
|
||||
"@0x/contracts-exchange": "^2.1.9",
|
||||
"@0x/contracts-exchange-libs": "^3.0.3",
|
||||
"@0x/contracts-utils": "^3.1.10",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/base-contract": "^5.3.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.6",
|
||||
"@0x/contracts-erc20": "^2.2.12",
|
||||
"@0x/contracts-erc721": "^2.1.13",
|
||||
"@0x/contracts-exchange": "^2.1.12",
|
||||
"@0x/contracts-exchange-libs": "^3.0.6",
|
||||
"@0x/contracts-utils": "^3.2.2",
|
||||
"@0x/order-utils": "^8.3.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -130,6 +130,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
artifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
zrxAssetData,
|
||||
);
|
||||
exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
||||
@@ -148,6 +149,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
artifacts.BalanceThresholdFilter,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
exchangeInstance.address,
|
||||
erc721BalanceThresholdAsset.address,
|
||||
erc721alanceThreshold,
|
||||
@@ -157,6 +159,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
artifacts.BalanceThresholdFilter,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
exchangeInstance.address,
|
||||
erc20BalanceThresholdAsset.address,
|
||||
erc20BalanceThreshold,
|
||||
|
@@ -1,4 +1,3 @@
|
||||
import { DutchAuctionWrapper } from '@0x/contract-wrappers';
|
||||
import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
|
||||
import { DummyERC20TokenContract } from '@0x/contracts-erc20';
|
||||
import { DummyERC721TokenContract } from '@0x/contracts-erc721';
|
||||
@@ -82,7 +81,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
const erc721Balances = await erc721Wrapper.getBalancesAsync();
|
||||
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
|
||||
|
||||
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults);
|
||||
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults, artifacts);
|
||||
erc20Wrapper.addDummyTokenContract(wethContract as any);
|
||||
|
||||
const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address);
|
||||
@@ -90,6 +89,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
artifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
zrxAssetData,
|
||||
);
|
||||
const exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
||||
@@ -107,6 +107,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
artifacts.DutchAuction,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
exchangeInstance.address,
|
||||
);
|
||||
dutchAuctionContract = new DutchAuctionContract(dutchAuctionInstance.address, provider);
|
||||
@@ -149,7 +150,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
feeRecipientAddress,
|
||||
// taker address or sender address should be set to the ducth auction contract
|
||||
takerAddress: dutchAuctionContract.address,
|
||||
makerAssetData: DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
makerAssetData: assetDataUtils.encodeDutchAuctionAssetData(
|
||||
assetDataUtils.encodeERC20AssetData(defaultMakerAssetAddress),
|
||||
auctionBeginTimeSeconds,
|
||||
auctionBeginAmount,
|
||||
@@ -191,7 +192,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
describe('matchOrders', () => {
|
||||
it('should be worth the begin price at the begining of the auction', async () => {
|
||||
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp + 2);
|
||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||
defaultERC20MakerAssetData,
|
||||
auctionBeginTimeSeconds,
|
||||
auctionBeginAmount,
|
||||
@@ -205,7 +206,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
it('should be be worth the end price at the end of the auction', async () => {
|
||||
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds * 2);
|
||||
auctionEndTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds);
|
||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||
defaultERC20MakerAssetData,
|
||||
auctionBeginTimeSeconds,
|
||||
auctionBeginAmount,
|
||||
@@ -271,7 +272,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
it('should revert when auction expires', async () => {
|
||||
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds * 2);
|
||||
auctionEndTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds);
|
||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||
defaultERC20MakerAssetData,
|
||||
auctionBeginTimeSeconds,
|
||||
auctionBeginAmount,
|
||||
@@ -305,7 +306,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
});
|
||||
it('begin time is less than end time', async () => {
|
||||
auctionBeginTimeSeconds = new BigNumber(auctionEndTimeSeconds).plus(tenMinutesInSeconds);
|
||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||
defaultERC20MakerAssetData,
|
||||
auctionBeginTimeSeconds,
|
||||
auctionBeginAmount,
|
||||
@@ -333,7 +334,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
it('should match orders when ERC721', async () => {
|
||||
const makerAssetId = erc721MakerAssetIds[0];
|
||||
const erc721MakerAssetData = assetDataUtils.encodeERC721AssetData(erc721Token.address, makerAssetId);
|
||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||
erc721MakerAssetData,
|
||||
auctionBeginTimeSeconds,
|
||||
auctionBeginAmount,
|
||||
|
@@ -103,12 +103,14 @@ describe('OrderMatcher', () => {
|
||||
proxyArtifacts.ERC721Proxy,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
// Depoy exchange
|
||||
exchange = await ExchangeContract.deployFrom0xArtifactAsync(
|
||||
artifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||
);
|
||||
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||
@@ -126,6 +128,7 @@ describe('OrderMatcher', () => {
|
||||
artifacts.OrderMatcher,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
exchange.address,
|
||||
);
|
||||
// Set default addresses
|
||||
@@ -198,6 +201,7 @@ describe('OrderMatcher', () => {
|
||||
artifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.NULL_BYTES,
|
||||
);
|
||||
return expectContractCreationFailedAsync(
|
||||
@@ -205,6 +209,7 @@ describe('OrderMatcher', () => {
|
||||
artifacts.OrderMatcher,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
exchangeInstance.address,
|
||||
) as any) as sendTransactionResult,
|
||||
RevertReason.UnregisteredAssetProxy,
|
||||
@@ -727,6 +732,7 @@ describe('OrderMatcher', () => {
|
||||
erc721Artifacts.DummyERC721Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.DUMMY_TOKEN_NAME,
|
||||
constants.DUMMY_TOKEN_SYMBOL,
|
||||
);
|
||||
@@ -772,6 +778,7 @@ describe('OrderMatcher', () => {
|
||||
erc721Artifacts.DummyERC721Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.DUMMY_TOKEN_NAME,
|
||||
constants.DUMMY_TOKEN_SYMBOL,
|
||||
);
|
||||
@@ -789,6 +796,7 @@ describe('OrderMatcher', () => {
|
||||
erc721Artifacts.DummyERC721Token,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
constants.DUMMY_TOKEN_NAME,
|
||||
constants.DUMMY_TOKEN_SYMBOL,
|
||||
);
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "3.1.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "3.1.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.1.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564607468
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "3.1.9",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.12 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.11 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.10 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
||||
## v3.1.9 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-multisig",
|
||||
"version": "3.1.9",
|
||||
"version": "3.1.12",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,20 +47,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/multisig/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/abi-gen": "^4.1.1",
|
||||
"@0x/contracts-gen": "^1.0.13",
|
||||
"@0x/contracts-test-utils": "^3.1.14",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "*",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -68,14 +69,14 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.3",
|
||||
"@0x/contracts-erc20": "^2.2.9",
|
||||
"@0x/base-contract": "^5.3.2",
|
||||
"@0x/contracts-asset-proxy": "^2.2.6",
|
||||
"@0x/contracts-erc20": "^2.2.12",
|
||||
"@0x/contracts-utils": "2.0.1",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -61,17 +61,20 @@ describe('AssetProxyOwner', () => {
|
||||
proxyArtifacts.MixinAuthorizable,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
erc721Proxy = await MixinAuthorizableContract.deployFrom0xArtifactAsync(
|
||||
proxyArtifacts.MixinAuthorizable,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
const defaultAssetProxyContractAddresses: string[] = [];
|
||||
testAssetProxyOwner = await TestAssetProxyOwnerContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestAssetProxyOwner,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
owners,
|
||||
defaultAssetProxyContractAddresses,
|
||||
REQUIRED_APPROVALS,
|
||||
@@ -105,6 +108,7 @@ describe('AssetProxyOwner', () => {
|
||||
artifacts.AssetProxyOwner,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
owners,
|
||||
assetProxyContractAddresses,
|
||||
REQUIRED_APPROVALS,
|
||||
@@ -122,6 +126,7 @@ describe('AssetProxyOwner', () => {
|
||||
artifacts.AssetProxyOwner,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
owners,
|
||||
assetProxyContractAddresses,
|
||||
REQUIRED_APPROVALS,
|
||||
|
@@ -66,6 +66,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
||||
artifacts.MultiSigWalletWithTimeLock,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
owners,
|
||||
REQUIRED_APPROVALS,
|
||||
secondsTimeLocked,
|
||||
@@ -81,6 +82,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
||||
artifacts.MultiSigWalletWithTimeLock,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
owners,
|
||||
REQUIRED_APPROVALS,
|
||||
secondsTimeLocked,
|
||||
@@ -135,6 +137,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
||||
artifacts.MultiSigWalletWithTimeLock,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
owners,
|
||||
REQUIRED_APPROVALS,
|
||||
secondsTimeLocked,
|
||||
@@ -198,6 +201,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
||||
artifacts.TestRejectEther,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
const data = constants.NULL_BYTES;
|
||||
const value = new BigNumber(10);
|
||||
@@ -234,6 +238,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
||||
artifacts.MultiSigWalletWithTimeLock,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
owners,
|
||||
REQUIRED_APPROVALS,
|
||||
secondsTimeLocked,
|
||||
@@ -308,6 +313,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
||||
artifacts.MultiSigWalletWithTimeLock,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
owners,
|
||||
REQUIRED_APPROVALS,
|
||||
SECONDS_TIME_LOCKED,
|
||||
|
@@ -4,14 +4,17 @@ import { BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { TransactionReceiptWithDecodedLogs } from 'ethereum-types';
|
||||
|
||||
import { AssetProxyOwnerContract } from '../../generated-wrappers/asset_proxy_owner';
|
||||
import { AssetProxyOwnerContract, TestAssetProxyOwnerContract } from '../../src';
|
||||
import { artifacts } from '../../src/artifacts';
|
||||
|
||||
export class AssetProxyOwnerWrapper {
|
||||
private readonly _assetProxyOwner: AssetProxyOwnerContract;
|
||||
private readonly _assetProxyOwner: AssetProxyOwnerContract | TestAssetProxyOwnerContract;
|
||||
private readonly _web3Wrapper: Web3Wrapper;
|
||||
private readonly _logDecoder: LogDecoder;
|
||||
constructor(assetproxyOwnerContract: AssetProxyOwnerContract, provider: Web3ProviderEngine) {
|
||||
constructor(
|
||||
assetproxyOwnerContract: AssetProxyOwnerContract | TestAssetProxyOwnerContract,
|
||||
provider: Web3ProviderEngine,
|
||||
) {
|
||||
this._assetProxyOwner = assetproxyOwnerContract;
|
||||
this._web3Wrapper = new Web3Wrapper(provider);
|
||||
this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...proxyArtifacts });
|
||||
@@ -57,7 +60,7 @@ export class AssetProxyOwnerWrapper {
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
// tslint:disable-next-line:no-unnecessary-type-assertion
|
||||
const txHash = await (this
|
||||
._assetProxyOwner as AssetProxyOwnerContract).executeRemoveAuthorizedAddressAtIndex.sendTransactionAsync(
|
||||
._assetProxyOwner as TestAssetProxyOwnerContract).executeRemoveAuthorizedAddressAtIndex.sendTransactionAsync(
|
||||
txId,
|
||||
{
|
||||
from,
|
||||
|
@@ -3,14 +3,17 @@ import { BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { TransactionReceiptWithDecodedLogs } from 'ethereum-types';
|
||||
|
||||
import { MultiSigWalletContract } from '../../generated-wrappers/multi_sig_wallet';
|
||||
import { MultiSigWalletContract, MultiSigWalletWithTimeLockContract } from '../../src';
|
||||
import { artifacts } from '../../src/artifacts';
|
||||
|
||||
export class MultiSigWrapper {
|
||||
private readonly _multiSig: MultiSigWalletContract;
|
||||
private readonly _multiSig: MultiSigWalletContract | MultiSigWalletWithTimeLockContract;
|
||||
private readonly _web3Wrapper: Web3Wrapper;
|
||||
private readonly _logDecoder: LogDecoder;
|
||||
constructor(multiSigContract: MultiSigWalletContract, provider: Web3ProviderEngine) {
|
||||
constructor(
|
||||
multiSigContract: MultiSigWalletContract | MultiSigWalletWithTimeLockContract,
|
||||
provider: Web3ProviderEngine,
|
||||
) {
|
||||
this._multiSig = multiSigContract;
|
||||
this._web3Wrapper = new Web3Wrapper(provider);
|
||||
this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts);
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "3.1.14",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "3.1.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1564604963,
|
||||
"version": "3.1.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "3.1.11",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.14 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.13 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.12 - _July 31, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.11 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-test-utils",
|
||||
"version": "3.1.11",
|
||||
"version": "3.1.14",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -34,25 +34,26 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/test-utils/README.md",
|
||||
"devDependencies": {
|
||||
"mocha": "^4.1.0",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"tslint": "5.11.0",
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/sol-coverage": "^3.0.7",
|
||||
"@0x/sol-profiler": "^3.1.9",
|
||||
"@0x/sol-trace": "^2.0.15",
|
||||
"@0x/subproviders": "^4.1.2",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/order-utils": "^8.3.0",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/sol-coverage": "^3.0.10",
|
||||
"@0x/sol-profiler": "^3.1.12",
|
||||
"@0x/sol-trace": "^2.0.18",
|
||||
"@0x/subproviders": "^5.0.2",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"@types/lodash": "4.14.104",
|
||||
|
@@ -1,4 +1,36 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "3.2.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "3.2.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.2.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||
"pr": 1995
|
||||
},
|
||||
{
|
||||
"note": "Added tests for decoding log arguments when artifact dependencies are included/excluded.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564604963
|
||||
},
|
||||
{
|
||||
"timestamp": 1563957393,
|
||||
"version": "3.1.10",
|
||||
|
@@ -5,6 +5,19 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.2.2 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.2.1 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.2.0 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
* Added tests for decoding log arguments when artifact dependencies are included/excluded. (#1995)
|
||||
|
||||
## v3.1.10 - _July 24, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -32,6 +32,8 @@
|
||||
"src/interfaces/IOwnable.sol",
|
||||
"test/TestConstants.sol",
|
||||
"test/TestLibAddressArray.sol",
|
||||
"test/TestLibBytes.sol"
|
||||
"test/TestLibBytes.sol",
|
||||
"test/TestLogDecoding.sol",
|
||||
"test/TestLogDecodingDownstream.sol"
|
||||
]
|
||||
}
|
||||
|
55
contracts/utils/contracts/test/TestLogDecoding.sol
Normal file
55
contracts/utils/contracts/test/TestLogDecoding.sol
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
|
||||
Copyright 2018 ZeroEx Intl.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
import "./TestLogDecodingDownstream.sol";
|
||||
|
||||
|
||||
contract TestLogDecoding {
|
||||
|
||||
/// @dev arbitrary event; fields to not matter.
|
||||
event TestEvent(
|
||||
uint256 foo,
|
||||
bytes bar,
|
||||
string car
|
||||
);
|
||||
|
||||
/// @dev Emits a local event
|
||||
function emitEvent()
|
||||
public
|
||||
{
|
||||
emit TestEvent(256, hex'1234', "4321");
|
||||
}
|
||||
|
||||
/// @dev Emits an event in a downstream contract
|
||||
function emitEventDownstream()
|
||||
public
|
||||
{
|
||||
TestLogDecodingDownstream testLogDecodingDownstream = new TestLogDecodingDownstream();
|
||||
ITestLogDecodingDownstream(testLogDecodingDownstream).emitEvent();
|
||||
}
|
||||
|
||||
/// @dev Emits a local event and a downstream event
|
||||
function emitEventsLocalAndDownstream()
|
||||
public
|
||||
{
|
||||
emitEvent();
|
||||
emitEventDownstream();
|
||||
}
|
||||
}
|
48
contracts/utils/contracts/test/TestLogDecodingDownstream.sol
Normal file
48
contracts/utils/contracts/test/TestLogDecodingDownstream.sol
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
|
||||
Copyright 2018 ZeroEx Intl.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
|
||||
contract ITestLogDecodingDownstream {
|
||||
|
||||
/// @dev Emits a local event
|
||||
function emitEvent() external;
|
||||
}
|
||||
|
||||
|
||||
contract TestLogDecodingDownstream is
|
||||
ITestLogDecodingDownstream
|
||||
{
|
||||
|
||||
/// @dev event with fields different than those in `TestLogDecoding.TestEvent`
|
||||
/// Note: do not include this in the interface
|
||||
/// For testing, we want to emit an event that is
|
||||
/// not known by the calling contract.
|
||||
event TestEvent2(
|
||||
uint256 lorem,
|
||||
string ipsum
|
||||
);
|
||||
|
||||
/// @dev Emits a local event
|
||||
function emitEvent()
|
||||
external
|
||||
{
|
||||
emit TestEvent2(256, "4321");
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-utils",
|
||||
"version": "3.1.10",
|
||||
"version": "3.2.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -34,7 +34,7 @@
|
||||
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
|
||||
},
|
||||
"config": {
|
||||
"abis": "./generated-artifacts/@(Address|IOwnable|LibBytes|Ownable|ReentrancyGuard|SafeMath|TestConstants|TestLibAddressArray|TestLibBytes).json",
|
||||
"abis": "./generated-artifacts/@(Address|IOwnable|LibBytes|Ownable|ReentrancyGuard|SafeMath|TestConstants|TestLibAddressArray|TestLibBytes|TestLogDecoding|TestLogDecodingDownstream).json",
|
||||
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
|
||||
},
|
||||
"repository": {
|
||||
@@ -47,21 +47,22 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.1",
|
||||
"@0x/contracts-gen": "^1.0.11",
|
||||
"@0x/contracts-test-utils": "^3.1.11",
|
||||
"@0x/dev-utils": "^2.2.5",
|
||||
"@0x/sol-compiler": "^3.1.10",
|
||||
"@0x/abi-gen": "^4.1.1",
|
||||
"@0x/contracts-gen": "^1.0.13",
|
||||
"@0x/contracts-test-utils": "^3.1.14",
|
||||
"@0x/dev-utils": "^2.3.1",
|
||||
"@0x/sol-compiler": "^3.1.13",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "*",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -69,12 +70,12 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.2",
|
||||
"@0x/order-utils": "^8.2.3",
|
||||
"@0x/base-contract": "^5.3.2",
|
||||
"@0x/order-utils": "^8.3.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.1",
|
||||
"@0x/web3-wrapper": "^6.0.8",
|
||||
"@0x/utils": "^4.5.0",
|
||||
"@0x/web3-wrapper": "^6.0.11",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
|
@@ -14,6 +14,8 @@ import * as SafeMath from '../generated-artifacts/SafeMath.json';
|
||||
import * as TestConstants from '../generated-artifacts/TestConstants.json';
|
||||
import * as TestLibAddressArray from '../generated-artifacts/TestLibAddressArray.json';
|
||||
import * as TestLibBytes from '../generated-artifacts/TestLibBytes.json';
|
||||
import * as TestLogDecoding from '../generated-artifacts/TestLogDecoding.json';
|
||||
import * as TestLogDecodingDownstream from '../generated-artifacts/TestLogDecodingDownstream.json';
|
||||
export const artifacts = {
|
||||
Address: Address as ContractArtifact,
|
||||
LibBytes: LibBytes as ContractArtifact,
|
||||
@@ -22,6 +24,8 @@ export const artifacts = {
|
||||
SafeMath: SafeMath as ContractArtifact,
|
||||
IOwnable: IOwnable as ContractArtifact,
|
||||
TestConstants: TestConstants as ContractArtifact,
|
||||
TestLibBytes: TestLibBytes as ContractArtifact,
|
||||
TestLibAddressArray: TestLibAddressArray as ContractArtifact,
|
||||
TestLibBytes: TestLibBytes as ContractArtifact,
|
||||
TestLogDecoding: TestLogDecoding as ContractArtifact,
|
||||
TestLogDecodingDownstream: TestLogDecodingDownstream as ContractArtifact,
|
||||
};
|
||||
|
@@ -12,3 +12,5 @@ export * from '../generated-wrappers/safe_math';
|
||||
export * from '../generated-wrappers/test_constants';
|
||||
export * from '../generated-wrappers/test_lib_address_array';
|
||||
export * from '../generated-wrappers/test_lib_bytes';
|
||||
export * from '../generated-wrappers/test_log_decoding';
|
||||
export * from '../generated-wrappers/test_log_decoding_downstream';
|
||||
|
@@ -28,6 +28,7 @@ describe('LibAddressArray', () => {
|
||||
artifacts.TestLibAddressArray,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
});
|
||||
after(async () => {
|
||||
|
@@ -68,7 +68,12 @@ describe('LibBytes', () => {
|
||||
testAddress = accounts[1];
|
||||
testAddressB = accounts[2];
|
||||
// Deploy LibBytes
|
||||
libBytes = await TestLibBytesContract.deployFrom0xArtifactAsync(artifacts.TestLibBytes, provider, txDefaults);
|
||||
libBytes = await TestLibBytesContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestLibBytes,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
// Verify lengths of test data
|
||||
const byteArrayShorterThan32BytesLength = ethUtil.toBuffer(byteArrayShorterThan32Bytes).byteLength;
|
||||
expect(byteArrayShorterThan32BytesLength).to.be.lessThan(32);
|
||||
|
@@ -24,6 +24,7 @@ describe('Libs', () => {
|
||||
artifacts.TestConstants,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
const isValid = await testConstants.assertValidZrxAssetData.callAsync();
|
||||
expect(isValid).to.be.equal(true);
|
||||
|
95
contracts/utils/test/log_decoding.ts
Normal file
95
contracts/utils/test/log_decoding.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import { chaiSetup, provider, txDefaults, web3Wrapper } from '@0x/contracts-test-utils';
|
||||
import { BlockchainLifecycle } from '@0x/dev-utils';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import * as chai from 'chai';
|
||||
import { DecodedLogArgs, LogWithDecodedArgs } from 'ethereum-types';
|
||||
|
||||
import { artifacts, TestLogDecodingContract } from '../src';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
describe('TestLogDecoding', () => {
|
||||
let testLogDecodingWithDependencies: TestLogDecodingContract;
|
||||
let testLogDecodingDeployedWithoutDependencies: TestLogDecodingContract;
|
||||
const expectedEvent = {
|
||||
foo: new BigNumber(256),
|
||||
bar: '0x1234',
|
||||
car: '4321',
|
||||
};
|
||||
const expectedDownstreamEvent = {
|
||||
lorem: new BigNumber(256),
|
||||
ipsum: '4321',
|
||||
};
|
||||
const emptyDependencyList = {};
|
||||
|
||||
before(async () => {
|
||||
testLogDecodingDeployedWithoutDependencies = await TestLogDecodingContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestLogDecoding,
|
||||
provider,
|
||||
txDefaults,
|
||||
emptyDependencyList,
|
||||
);
|
||||
testLogDecodingWithDependencies = await TestLogDecodingContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestLogDecoding,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
);
|
||||
});
|
||||
beforeEach(async () => {
|
||||
await blockchainLifecycle.startAsync();
|
||||
});
|
||||
afterEach(async () => {
|
||||
await blockchainLifecycle.revertAsync();
|
||||
});
|
||||
|
||||
describe('Decoding Log Arguments', () => {
|
||||
it('should decode locally emitted event args when no dependencies are passed into wrapper', async () => {
|
||||
const txReceipt = await testLogDecodingDeployedWithoutDependencies.emitEvent.awaitTransactionSuccessAsync();
|
||||
expect(txReceipt.logs.length).to.be.equal(1);
|
||||
// tslint:disable no-unnecessary-type-assertion
|
||||
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedEvent);
|
||||
});
|
||||
it('should not decode event args when no dependencies are passed into wrapper', async () => {
|
||||
const txReceipt = await testLogDecodingDeployedWithoutDependencies.emitEventDownstream.awaitTransactionSuccessAsync();
|
||||
expect(txReceipt.logs.length).to.be.equal(1);
|
||||
// tslint:disable no-unnecessary-type-assertion
|
||||
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.undefined();
|
||||
});
|
||||
it('should decode args for local but not downstream event when no dependencies are passed into wrapper', async () => {
|
||||
const txReceipt = await testLogDecodingDeployedWithoutDependencies.emitEventsLocalAndDownstream.awaitTransactionSuccessAsync();
|
||||
expect(txReceipt.logs.length).to.be.equal(2);
|
||||
// tslint:disable no-unnecessary-type-assertion
|
||||
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedEvent);
|
||||
// tslint:disable no-unnecessary-type-assertion
|
||||
expect((txReceipt.logs[1] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.undefined();
|
||||
});
|
||||
it('should decode locally emitted event args when dependencies are passed into wrapper', async () => {
|
||||
const txReceipt = await testLogDecodingWithDependencies.emitEvent.awaitTransactionSuccessAsync();
|
||||
expect(txReceipt.logs.length).to.be.equal(1);
|
||||
// tslint:disable no-unnecessary-type-assertion
|
||||
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedEvent);
|
||||
});
|
||||
it('should decode downstream event args when dependencies are passed into wrapper', async () => {
|
||||
const txReceipt = await testLogDecodingWithDependencies.emitEventDownstream.awaitTransactionSuccessAsync();
|
||||
expect(txReceipt.logs.length).to.be.equal(1);
|
||||
// tslint:disable no-unnecessary-type-assertion
|
||||
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(
|
||||
expectedDownstreamEvent,
|
||||
);
|
||||
});
|
||||
it('should decode args for both local and downstream events when dependencies are passed into wrapper', async () => {
|
||||
const txReceipt = await testLogDecodingWithDependencies.emitEventsLocalAndDownstream.awaitTransactionSuccessAsync();
|
||||
expect(txReceipt.logs.length).to.be.equal(2);
|
||||
// tslint:disable no-unnecessary-type-assertion
|
||||
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedEvent);
|
||||
// tslint:disable no-unnecessary-type-assertion
|
||||
expect((txReceipt.logs[1] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(
|
||||
expectedDownstreamEvent,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
@@ -11,7 +11,9 @@
|
||||
"generated-artifacts/SafeMath.json",
|
||||
"generated-artifacts/TestConstants.json",
|
||||
"generated-artifacts/TestLibAddressArray.json",
|
||||
"generated-artifacts/TestLibBytes.json"
|
||||
"generated-artifacts/TestLibBytes.json",
|
||||
"generated-artifacts/TestLogDecoding.json",
|
||||
"generated-artifacts/TestLogDecodingDownstream.json"
|
||||
],
|
||||
"exclude": ["./deploy/solc/solc_bin"]
|
||||
}
|
||||
|
1
env/.Python
vendored
Symbolic link
1
env/.Python
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/Python
|
84
env/bin/activate
vendored
Normal file
84
env/bin/activate
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
# This file must be used with "source bin/activate" *from bash*
|
||||
# you cannot run it directly
|
||||
|
||||
|
||||
if [ "${BASH_SOURCE-}" = "$0" ]; then
|
||||
echo "You must source this script: \$ source $0" >&2
|
||||
exit 33
|
||||
fi
|
||||
|
||||
deactivate () {
|
||||
unset -f pydoc >/dev/null 2>&1
|
||||
|
||||
# reset old environment variables
|
||||
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all
|
||||
if ! [ -z "${_OLD_VIRTUAL_PATH:+_}" ] ; then
|
||||
PATH="$_OLD_VIRTUAL_PATH"
|
||||
export PATH
|
||||
unset _OLD_VIRTUAL_PATH
|
||||
fi
|
||||
if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
|
||||
PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
|
||||
export PYTHONHOME
|
||||
unset _OLD_VIRTUAL_PYTHONHOME
|
||||
fi
|
||||
|
||||
# This should detect bash and zsh, which have a hash command that must
|
||||
# be called to get it to forget past commands. Without forgetting
|
||||
# past commands the $PATH changes we made may not be respected
|
||||
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
|
||||
hash -r 2>/dev/null
|
||||
fi
|
||||
|
||||
if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
|
||||
PS1="$_OLD_VIRTUAL_PS1"
|
||||
export PS1
|
||||
unset _OLD_VIRTUAL_PS1
|
||||
fi
|
||||
|
||||
unset VIRTUAL_ENV
|
||||
if [ ! "${1-}" = "nondestructive" ] ; then
|
||||
# Self destruct!
|
||||
unset -f deactivate
|
||||
fi
|
||||
}
|
||||
|
||||
# unset irrelevant variables
|
||||
deactivate nondestructive
|
||||
|
||||
VIRTUAL_ENV="/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env"
|
||||
export VIRTUAL_ENV
|
||||
|
||||
_OLD_VIRTUAL_PATH="$PATH"
|
||||
PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
export PATH
|
||||
|
||||
# unset PYTHONHOME if set
|
||||
if ! [ -z "${PYTHONHOME+_}" ] ; then
|
||||
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
|
||||
unset PYTHONHOME
|
||||
fi
|
||||
|
||||
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
|
||||
_OLD_VIRTUAL_PS1="${PS1-}"
|
||||
if [ "x" != x ] ; then
|
||||
PS1="${PS1-}"
|
||||
else
|
||||
PS1="(`basename \"$VIRTUAL_ENV\"`) ${PS1-}"
|
||||
fi
|
||||
export PS1
|
||||
fi
|
||||
|
||||
# Make sure to unalias pydoc if it's already there
|
||||
alias pydoc 2>/dev/null >/dev/null && unalias pydoc || true
|
||||
|
||||
pydoc () {
|
||||
python -m pydoc "$@"
|
||||
}
|
||||
|
||||
# This should detect bash and zsh, which have a hash command that must
|
||||
# be called to get it to forget past commands. Without forgetting
|
||||
# past commands the $PATH changes we made may not be respected
|
||||
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
|
||||
hash -r 2>/dev/null
|
||||
fi
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user