Compare commits

...

345 Commits

Author SHA1 Message Date
Jacob Evans
bbd3c03969 Publish
- @0x/contracts-asset-proxy@2.2.6
 - @0x/contracts-coordinator@2.0.11
 - @0x/contracts-dev-utils@0.0.8
 - @0x/contracts-erc1155@1.1.13
 - @0x/contracts-erc20@2.2.12
 - @0x/contracts-erc721@2.1.13
 - @0x/contracts-exchange-forwarder@3.0.10
 - @0x/contracts-exchange-libs@3.0.6
 - @0x/contracts-exchange@2.1.12
 - @0x/contracts-extensions@4.0.6
 - @0x/contracts-multisig@3.1.12
 - @0x/contracts-test-utils@3.1.14
 - @0x/contracts-utils@3.2.2
 - 0x.js@7.0.0
 - @0x/abi-gen-templates@2.4.2
 - @0x/abi-gen-wrappers@5.3.0
 - @0x/abi-gen@4.1.1
 - @0x/assert@2.1.4
 - @0x/asset-buyer@6.1.12
 - @0x/asset-swapper@1.0.2
 - @0x/base-contract@5.3.2
 - @0x/connect@5.0.17
 - @0x/contract-addresses@3.1.0
 - @0x/contract-artifacts@2.2.0
 - @0x/contract-wrappers@11.1.0
 - @0x/dev-utils@2.3.1
 - @0x/fill-scenarios@3.0.17
 - @0x/instant@1.0.29
 - @0x/json-schemas@4.0.0
 - @0x/migrations@4.3.0
 - @0x/monorepo-scripts@1.0.35
 - @0x/order-utils@8.3.0
 - @0x/python-contract-wrappers@1.0.4
 - @0x/sol-compiler@3.1.13
 - @0x/sol-coverage@3.0.10
 - @0x/sol-doc@2.0.17
 - @0x/sol-profiler@3.1.12
 - @0x/sol-trace@2.0.18
 - @0x/sol-tracing-utils@6.0.17
 - @0x/sra-spec@2.0.15
 - @0x/subproviders@5.0.2
 - @0x/testnet-faucets@1.0.85
 - @0x/web3-wrapper@6.0.11
 - @0x/website@0.0.88
2019-08-22 14:13:00 +10:00
Jacob Evans
a4405c3d39 Updated CHANGELOGS 2019-08-22 14:12:40 +10:00
Xianny
0fe4f587d8 update ethereumjs-blockstream 6.0.0 -> ^7.0.0 (#2089) 2019-08-21 18:39:07 -07:00
Francesco Agosti
d3c714bd17 Merge pull request #2085 from 0xProject/feature/cfl-page-fix
Fix small issue on mobile nav
2019-08-21 14:54:17 -07:00
fragosti
c399b7a7d5 Add Asset Swapper to footer 2019-08-21 14:30:55 -07:00
fragosti
b9234e94fb Fix small issue on mobile nav 2019-08-21 14:30:55 -07:00
Francesco Agosti
417bb87785 Merge pull request #2081 from 0xProject/feature/cfl-page
CFL page
2019-08-20 18:24:40 -07:00
fragosti
0233ae3134 Use Asset Swapper on CFL page 2019-08-20 17:48:57 -07:00
fragosti
eed0c5dd59 Distinguish between asset swapper page and docs 2019-08-20 17:39:15 -07:00
fragosti
2b3b167095 Fix path of asset swapper link in product dropdown 2019-08-20 17:30:15 -07:00
fragosti
5d91d19808 Disable jsx-curly-spacing on cfl page 2019-08-20 17:24:49 -07:00
fragosti
0f374ddee9 Change AssetBuyer to AssetSwapper on instant page 2019-08-20 17:08:03 -07:00
Chris Kalani
a65a9913cd Fixed up some design nits and updated copy 2019-08-20 16:51:06 -07:00
fragosti
1ead32c666 Asset-Swapper -> asset-swapper 2019-08-20 15:35:39 -07:00
fragosti
d1af9fc780 use asset-swapper instead of Asset-Swapper 2019-08-20 15:31:50 -07:00
fragosti
0f06737fb6 Fix install prompt on mobile layout 2019-08-20 15:01:59 -07:00
fragosti
1676231532 Rename variables to be compatible with new backend 2019-08-20 14:36:57 -07:00
fragosti
b1caf697c8 Update titles and descriptions 2019-08-20 13:52:50 -07:00
fragosti
51481065fe Fix jumping around of editor 2019-08-20 11:56:09 -07:00
fragosti
e367da710c Fix massive i 2019-08-20 11:47:05 -07:00
fragosti
f493d6524d Change to crypto algo-traders 2019-08-20 11:22:21 -07:00
fragosti
e1b85da2a7 Make terminal text selectable 2019-08-20 11:16:28 -07:00
F. Eugene Aumson
22c6548ed1 abi-gen/test-cli: rm expected-output; use git diff (#2079)
* abi-gen/test-cli: rm expected-output; use git diff

* abi-gen/test-cli: Simplify git diff test script

* Remove abi-gen/test-cli/output from .gitignore
2019-08-20 14:08:54 -04:00
Fabio B
afb32c087d Merge pull request #2017 from jangerritharms/fix/broken-validator-signatures
Fix broken validator signatures
2019-08-20 18:44:50 +02:00
Jan-Gerrit Harms
bbc1ed1c64 Update test to adhere to v2.1 Validator revert 2019-08-20 14:53:10 +02:00
Jan-Gerrit Harms
3a46f1a27a Merge branch 'development' into fix/broken-validator-signatures 2019-08-20 09:30:21 +02:00
Jacob Evans
90cd364780 Merge pull request #2078 from 0xProject/fix/isValidSignature-2.1
Update development to 2.1 isValidSignature with magic salt
2019-08-20 16:34:48 +10:00
Jacob Evans
6795e6f078 Update comments with bytes4 values 2019-08-20 16:15:44 +10:00
fragosti
cfb3404349 Fix dogfood link 2019-08-19 20:49:35 -07:00
fragosti
0212f3ee78 Run linter 2019-08-19 19:28:42 -07:00
fragosti
6b2995a4ee Remove didError state from CFLmetrics component 2019-08-19 19:24:37 -07:00
fragosti
09e7ac54d4 Replace hummingbot link 2019-08-19 19:18:58 -07:00
fragosti
f69009d4a8 Add CFL to mobile dropdown and remove extensions for desktop 2019-08-19 19:16:26 -07:00
fragosti
206802ae33 Make layout more responsive 2019-08-19 19:08:48 -07:00
fragosti
91d4138fb8 Fix react key error 2019-08-19 18:22:17 -07:00
fragosti
cb455f951a Add loading state to CFL metrics 2019-08-19 18:19:01 -07:00
fragosti
5f25d20cd0 Improve tooltip and copy 2019-08-19 17:54:10 -07:00
fragosti
1f0e2cd910 Add info tooltip 2019-08-19 17:46:11 -07:00
Jacob Evans
1749d02701 Add python linter exception 2019-08-20 10:30:09 +10:00
fragosti
55ace3179c Add disclaimer component 2019-08-19 17:00:41 -07:00
fragosti
7866d9ccb4 Implement CFL metrics MVP 2019-08-19 16:52:40 -07:00
Brandon Millman
51f73d07fa Merge pull request #2080 from 0xProject/feature/website/adding-michael
Adding Michael Zhu to the team page
2019-08-19 13:02:18 -07:00
Francesco Agosti
63d84674ab Merge pull request #2074 from 0xProject/feature/website/remove-faq
Removing the old FAQ page and all references
2019-08-19 12:36:59 -07:00
Chris Kalani
14066997b2 Adding Michael Zhu to the team page 2019-08-19 12:34:19 -07:00
F. Eugene Aumson
28561e765a Update README.md (#2077)
* Update README.md

* top-level README.md: explain Python dependency

* top-level README.md: suggest node v6 OR v8
2019-08-19 13:55:06 -04:00
Jacob Evans
453fbbdc5d Update python doc strings 2019-08-19 15:55:28 +10:00
Jacob Evans
1e1e5ec10d Catch revert in IWallet/IValidator and return false 2019-08-19 15:45:32 +10:00
Jacob Evans
2088b0e459 Update python doc string 2019-08-19 15:13:09 +10:00
Jacob Evans
58400d9e01 Update python docs string 2019-08-19 14:40:46 +10:00
Jacob Evans
ac9375f1d2 Updated generated-wrappers? 2019-08-19 14:10:50 +10:00
Jacob Evans
db061c9355 Update Whitelist.sol 2019-08-19 12:15:46 +10:00
Jacob Evans
d5ce6c464b Update Wallet signature test 2019-08-19 11:55:48 +10:00
Jacob Evans
b06205bb7f Fix lint errors 2019-08-19 11:36:35 +10:00
Jacob Evans
f528a3e1de Update Order-utils to check magic values 2019-08-19 11:14:35 +10:00
Jacob Evans
bddfdacfad Update Interfaces for IValidator and IWallet 2019-08-19 11:08:06 +10:00
Jacob Evans
d3cdd3f235 Update development to 2.1 isValidSignature with magic salt 2019-08-19 10:35:26 +10:00
Chris Kalani
41ae45ea40 Fixed build error 2019-08-16 14:17:12 -07:00
Chris Kalani
657e0895ea Removing the olf FAW page and all references 2019-08-16 13:56:03 -07:00
F. Eugene Aumson
0ae2d8bab5 sra_client.py: don't test against Python 2.7 (#2071) 2019-08-16 13:32:59 -04:00
F. Eugene Aumson
3e0bd1f02d Run CI in an environment that includes Python, and test generated code (#2072)
* CI: use a docker image that includes Python

So that tests of abi-gen generating Python can exercise the code being
generated.

* CI fix: disable old yarn permission denied hack

Motivated by CI failure of previous commit.

* CI fix: more resources for test-contracts-ganache

Motivated by CI failure of previous commit.

* CI fix: remove hack of permissions for python libs

Fix for previous CI run's failure of test-python.  Apparently we don't
need this in the docker container we've switched to.

* abi-gen/Py: minimum viable test of gen'd code

Ensure the code is parseable by running it through black.

* abi-gen/Py: expand Python linter usage

Make abi-gen filter its output through black, if its available in the
runtime environment.  Accordingly, stop having contract_wrappers.py's
setup.py pre_install run black on copied-over files.

Adds Pylint to the list of linters run against test-cli/output.

* abi-gen: re-enable Solidity linter

It was broken, running seemingly cleanly but not actually reading any
files, because it was targetting the wrong folder.

* abi-gen/test-cli/fixtures/sol: fix linter errors

* abi-gen/test-cli: disable pylint blackisted-name

* abi-gen/Py: rm unused var in contracts w/o methods

Remove unused variable from generated wrapper for contracts without any
methods.
2019-08-16 13:32:31 -04:00
Jan-Gerrit Harms
b2592d1cc2 Removed the order-watcher files that were accidentally added 2019-08-16 14:02:32 +02:00
Jan-Gerrit Harms
aa3524c3b2 Merge branch 'development' into fix/broken-validator-signatures 2019-08-16 13:04:27 +02:00
Fabio B
35fcfb978d Merge pull request #2054 from Arctek/fix/metamask-subprovider-hw
subproviders: Change MetamaskSubprovider eth_sign to personal_sign
2019-08-16 12:08:10 +02:00
Fabio B
c68083cf03 Remove timestamp from latest entry 2019-08-16 12:07:45 +02:00
fragosti
39deb1a05f Make it possible to show figure in hero on the bottom on mobile 2019-08-15 17:23:20 -07:00
fragosti
302d08e290 Make website mobile friendly 2019-08-15 17:01:50 -07:00
fragosti
05489dd7f1 Implement basic CFL landing page 2019-08-15 16:33:52 -07:00
fabioberger
cfb5119efc Update abi-gen-wrappers 2019-08-16 00:51:00 +02:00
F. Eugene Aumson
5d53fa5635 contract_wrappers.py: bump version after publish (#2064) 2019-08-15 16:34:31 -04:00
Xianny
38d2b70ba6 Update contract-wrappers everywhere (#2068)
* add validateAndSendTransactionAsync to all wrappers

* remove contract-wrappers from @0x/contracts-extensions

* replace error types in contract-wrappers

* upgrade asset-buyer and asset-swapper to contract-wrappers v11

* update website and 0x.js

* remove calldataOptimizationUtils
2019-08-15 10:53:33 -07:00
Xianny
29d5db16c2 copy artifacts should not use python path anymore (#2070) 2019-08-15 09:50:11 -07:00
Xianny
a8128c5772 Remove order-watcher (#2067)
* remove order-watcher
2019-08-14 14:34:59 -07:00
Jan-Gerrit Harms
55bd076602 Merge branch 'development' into fix/broken-validator-signatures 2019-08-14 09:37:20 +02:00
Joshua Richardson
53a08d00fd Merge branch 'development' of https://github.com/0xProject/0x-monorepo into fix/metamask-subprovider-hw 2019-08-14 12:29:44 +09:30
Joshua Richardson
fccec66463 Removed unrequired ethUtil import 2019-08-14 12:14:30 +09:30
Jacob Evans
bc26e807cd Merge pull request #2060 from 0xProject/feature/dev-utils-contract-wrappers
Added DevUtils Wrappers and migrations
2019-08-14 12:27:25 +10:00
Joshua Richardson
46dc37fb20 Update CHANGELOG.json 2019-08-14 11:40:02 +09:30
Jacob Evans
ccbb8400ee Merge branch 'development' into feature/dev-utils-contract-wrappers 2019-08-14 11:42:18 +10:00
Jacob Evans
5d3d8a5332 Merge pull request #2061 from 0xProject/feature/python/dev-utils-contract-wrapper
Add Python wrapper for DevUtils contract
2019-08-14 11:41:13 +10:00
Jan-Gerrit Harms
7a224fe08f Merge branch 'development' into fix/broken-validator-signatures 2019-08-13 19:49:24 +02:00
F. Eugene Aumson
e045f5f74b contract_wrappers.py: include DevUtils in docs 2019-08-13 12:16:20 -04:00
F. Eugene Aumson
e5c07ff0c5 abi-gen/Py: fix hanging indent for return val doc
The update to the fixture contract's artifact added a bunch of
`internalType` stuff.  I'm not sure where that came from.  Maybe
newly generated by the latest version of solc?
2019-08-13 12:16:20 -04:00
F. Eugene Aumson
cdf0aa27e4 contract_wrappers.py: Merge CHANGELOG from dev
Merge CHANGELOG updates from the development branch, in order to avoid
merge conflicts.
2019-08-13 09:32:31 -04:00
F. Eugene Aumson
88998e6bb7 contract_wrappers.py: add DevUtils wrapper 2019-08-13 09:28:03 -04:00
F. Eugene Aumson
b885dfa606 Fixes for broken tox runs (#2053)
* order_utils.py: git rm package.json

This was used at one time, a long, long time ago, but is no longer used,
and its presence actually causes problems when trying to do, eg
`PKG=@0x/python-contract-wrappers yarn build` from within the
order_utils directory.

* order_utils.py: improve `./setup.py clean`

* python-packages: in tox, test, don't lint

* python-packages: update dev req's to fix tox runs

* contract_wrappers.py: post-publish version bump
2019-08-13 09:18:16 -04:00
Jacob Evans
407495c278 Update packages/migrations/CHANGELOG.json
Co-Authored-By: Fabio B <me@fabioberger.com>
2019-08-13 21:56:07 +10:00
Jacob Evans
ea50a94355 Update Mainnet 2019-08-13 21:40:38 +10:00
Jacob Evans
cb3318972e Merge pull request #2044 from 0xProject/fix/sol-compiler-bin-publish
Remove solc-bin from npm publish
2019-08-13 21:16:32 +10:00
Jacob Evans
c057ad7977 Update CHANGELOG 2019-08-13 14:46:53 +10:00
Jacob Evans
eb21718462 Added DevUtils Wrappers 2019-08-13 14:44:53 +10:00
Francesco Agosti
7836e10d8a Merge pull request #2052 from 0xProject/feature/website/adding-oskar
Added Oskar to team page
2019-08-12 10:15:19 -07:00
Francesco Agosti
946a31821d Merge pull request #2050 from 0xProject/feature/website/privacy-policy
Privacy Policy and Terms of Service pages
2019-08-12 10:10:55 -07:00
xianny
92a915f477 fix dependency version check 2019-08-12 09:27:51 -07:00
Jacob Evans
60b458dbfb Merge pull request #2045 from 0xProject/feature/i-voted-tokens
I Voted Tokens
2019-08-12 17:24:07 +10:00
Joshua Richardson
8b13efc89a Fix for MetamaskSubprovider to use personal_sign over manually prefixing eth_sign, so proxied hardware wallets work (Ledger/Trezor). 2019-08-11 02:32:09 +09:30
Chris Kalani
88b625fa15 Added Oskar to team page 2019-08-09 17:28:12 -07:00
Chris Kalani
2cf9c9b7df Added Terms of Service page and footer links 2019-08-09 16:52:09 -07:00
Chris Kalani
d179d6a1a2 Added Privacy Policy Page 2019-08-09 16:17:10 -07:00
F. Eugene Aumson
08502c1eb6 Pre-publish version updates (#2049)
* json_schemas.py: make changelog be rev. chrono.

Change CHANGELOG.md from chronological to reverse chronological.

* json_schemas.py: fix version numbers

It looks like the version number was changed in the past, but the new
version was never published, so corrected that.  Will publish after this
merges into development.

* order_utils.py: pre-publish version bump
2019-08-09 19:15:57 -04:00
F. Eugene Aumson
384cd47416 order_utils.py: mk deprecated a REAL dependency (#2048) 2019-08-09 16:31:51 -04:00
Jan-Gerrit Harms
3bdeb82097 Updated CHANGELOG of 0x.js and @0x/order-watcher 2019-08-09 09:58:29 +02:00
Jan-Gerrit Harms
f49ab3f919 Merge branch 'development' into fix/broken-validator-signatures 2019-08-09 09:47:42 +02:00
Jan-Gerrit Harms
42d5bdd3ab Explicitly check exchangeAddress definedness 2019-08-09 09:39:49 +02:00
Jan-Gerrit Harms
7228cbfe92 Pass exchangeAddress instead of SignatureOpts 2019-08-09 09:36:32 +02:00
Fabio B
250c46d6a4 Merge pull request #2046 from 0xProject/feature/python/publish-gend-wrappers-and-web3-v5
Pre-publish updates
2019-08-08 23:17:15 +02:00
xianny
f394d7dba9 Publish
- @0x/contracts-asset-proxy@2.2.5
 - @0x/contracts-coordinator@2.0.10
 - @0x/contracts-dev-utils@0.0.7
 - @0x/contracts-erc1155@1.1.12
 - @0x/contracts-erc20@2.2.11
 - @0x/contracts-erc721@2.1.12
 - @0x/contracts-exchange-forwarder@3.0.9
 - @0x/contracts-exchange-libs@3.0.5
 - @0x/contracts-exchange@2.1.11
 - @0x/contracts-extensions@4.0.5
 - @0x/contracts-multisig@3.1.11
 - @0x/contracts-test-utils@3.1.13
 - @0x/contracts-utils@3.2.1
 - 0x.js@6.0.15
 - @0x/abi-gen-templates@2.4.1
 - @0x/abi-gen-wrappers@5.2.0
 - @0x/abi-gen@4.1.0
 - @0x/assert@2.1.3
 - @0x/asset-buyer@6.1.11
 - @0x/asset-swapper@1.0.1
 - @0x/base-contract@5.3.1
 - @0x/connect@5.0.16
 - @0x/contract-addresses@3.0.3
 - @0x/contract-artifacts@2.0.4
 - @0x/contract-wrappers@11.0.0
 - @0x/contracts-gen@1.0.13
 - @0x/dev-utils@2.3.0
 - @0x/fill-scenarios@3.0.16
 - @0x/instant@1.0.28
 - @0x/json-schemas@3.1.13
 - @0x/migrations@4.2.0
 - @0x/monorepo-scripts@1.0.34
 - @0x/order-utils@8.2.5
 - @0x/order-watcher@4.0.17
 - @0x/python-contract-wrappers@1.0.3
 - @0x/sol-compiler@3.1.12
 - @0x/sol-coverage@3.0.9
 - @0x/sol-doc@2.0.16
 - @0x/sol-profiler@3.1.11
 - @0x/sol-trace@2.0.17
 - @0x/sol-tracing-utils@6.0.16
 - @0x/sra-spec@2.0.14
 - @0x/subproviders@5.0.1
 - @0x/testnet-faucets@1.0.84
 - @0x/utils@4.5.0
 - @0x/web3-wrapper@6.0.10
 - @0x/website@0.0.87
2019-08-08 13:58:46 -07:00
xianny
ca595cd8cf Updated CHANGELOGS 2019-08-08 13:58:30 -07:00
F. Eugene Aumson
9ce71739f5 README.md: add 0x-contract-wrappers.py 2019-08-08 16:41:13 -04:00
F. Eugene Aumson
d69da38f7d python-packages: bump version numbers for publish 2019-08-08 16:22:42 -04:00
F. Eugene Aumson
50f69f734f contract_wrappers.py: fix ./setup.py clean 2019-08-08 16:20:24 -04:00
F. Eugene Aumson
fc9c6c5434 contract_addresses.py: update CHANGELOG 2019-08-08 16:19:37 -04:00
F. Eugene Aumson
6e941be1e9 make CHANGELOG be REVERSE chronological 2019-08-08 16:18:32 -04:00
F. Eugene Aumson
9f677150a4 python-packages: add convenience script 2019-08-08 16:15:41 -04:00
F. Eugene Aumson
11e273337f sra_client.py: add PyPI-required metadata 2019-08-08 16:11:37 -04:00
F. Eugene Aumson
ec807120c3 Migrate to Web3.py v5 (#2038)
* Install Py packages in dep. order, not in parallel

Install Python packages in dependency order, not in parallel.

* sra_client.py: Add `./setup.py clean`

* Fix python package dependency ordering...

...and include a script to produce the proper ordering.

* sra_client.py: reformat whitespace in doctest

* contract_wrappers.py: don't auto-import wrappers

This was discovered while minimizing CircleCI steps to dianose a problem
with running the Launch Kit Backend in CircleCI.

These classes should be imported via the
zero_ex.contract_wrappers.exchange and
zero_ex.contract_wrappers.erc20_token modules, respectively.  We
permitted importing them from just zero_ex.contract_wrappers back when
they were the only wrappers we had, but now that we have so many
different contracts being wrapped, this is just another list to keep
manually updated (which, obviously is error prone, since it slipped
through the cracks already), so it's better to just not support this
type of import.

* abi-gen/Py: doc contract method attributes

Without this, generated documentation was not including the class
members that represent the contract methods, rendering the usage
unclear.

* sra_client.py: disable tests in CI

* abi-gen/Py: strip repeated spaces from devdoc

* contract_wrappers.py: gen docs for all wrappers...

...except for the dummy tokens.

* sra_client.py/test: change launch kit docker image

Previously these teses were using 0xorg/launch-kit-ci, but that was a
one-off thing created just for CI, back before there was a regularly
maintained docker image of Launch Kit.

Changed to use 0xorg/launch-kit-backend since it's regularly
maintained/updated.

Because the -backend image is using a different Linux distribution
(Alpine), the commands used to wait for ganache startup also had to
change.

The tag used, 74bcc39, is provisional due to the pending Issue at
https://github.com/0xProject/0x-launch-kit-backend/issues/73 .  When
that issue is resolved, the tag suffix on the imag name should be
removed.

* Migrate from Web3.py 4.x to 5.x

* sra_client.py: checksum address in doctest

Due to problem with launch-kit-backend, documented at
https://github.com/0xProject/0x-launch-kit-backend/issues/73 ,
we need to checksum the makerAddress, in the order retrieved from the
relayer, before filling it, otherwise Web3.py gives this error:

InvalidAddress('Web3.py only accepts checksum addresses. The software
that gave you this non-checksum address should be considered unsafe,
please file it as a bug on their platform. Try using an ENS name
instead. Or, if you must accept lower safety, use
Web3.toChecksumAddress(lower_case_address).',
'0x5409ed021d9299bf6814279a6a1411a7e866a631')

* Update CHANGELOGs

* sra_client.py: make CHANGELOG be REVESE chrono.

Formerly CHANGELOG was in chronological order.  Now it's in reverse
chronological order.

* abi-gen/Py: fix missing space in sanitized devdoc
2019-08-08 14:53:59 -04:00
xianny
a5654debeb pin contract-wrappers to earlier version 2019-08-08 11:48:47 -07:00
xianny
0869c0d8b0 Revert "Updated CHANGELOGS"
This reverts commit b456c3f953.
2019-08-08 11:47:30 -07:00
xianny
b456c3f953 Updated CHANGELOGS 2019-08-08 11:41:38 -07:00
xianny
8297d68166 fix contract-wrappers version 2019-08-08 10:49:03 -07:00
xianny
18ce6797e0 Revert failed publish 2019-08-08 10:02:32 -07:00
xianny
c1009d440e Publish
- @0x/contracts-asset-proxy@2.2.5
 - @0x/contracts-coordinator@2.0.10
 - @0x/contracts-dev-utils@0.0.7
 - @0x/contracts-erc1155@1.1.12
 - @0x/contracts-erc20@2.2.11
 - @0x/contracts-erc721@2.1.12
 - @0x/contracts-exchange-forwarder@3.0.9
 - @0x/contracts-exchange-libs@3.0.5
 - @0x/contracts-exchange@2.1.11
 - @0x/contracts-extensions@4.0.5
 - @0x/contracts-multisig@3.1.11
 - @0x/contracts-test-utils@3.1.13
 - @0x/contracts-utils@3.2.1
 - 0x.js@6.0.15
 - @0x/abi-gen-templates@2.4.1
 - @0x/abi-gen-wrappers@5.2.0
 - @0x/abi-gen@4.1.0
 - @0x/assert@2.1.3
 - @0x/asset-buyer@6.1.11
 - @0x/asset-swapper@1.0.1
 - @0x/base-contract@5.3.1
 - @0x/connect@5.0.16
 - @0x/contract-addresses@3.0.3
 - @0x/contract-artifacts@2.0.4
 - @0x/contract-wrappers@11.0.0
 - @0x/contracts-gen@1.0.13
 - @0x/dev-utils@2.3.0
 - @0x/fill-scenarios@3.0.16
 - @0x/instant@1.0.28
 - @0x/json-schemas@3.1.13
 - @0x/migrations@4.2.0
 - @0x/monorepo-scripts@1.0.34
 - @0x/order-utils@8.2.5
 - @0x/order-watcher@4.0.17
 - @0x/python-contract-wrappers@1.0.3
 - @0x/sol-compiler@3.1.12
 - @0x/sol-coverage@3.0.9
 - @0x/sol-doc@2.0.16
 - @0x/sol-profiler@3.1.11
 - @0x/sol-trace@2.0.17
 - @0x/sol-tracing-utils@6.0.16
 - @0x/sra-spec@2.0.14
 - @0x/subproviders@5.0.1
 - @0x/testnet-faucets@1.0.84
 - @0x/utils@4.5.0
 - @0x/web3-wrapper@6.0.10
 - @0x/website@0.0.87
2019-08-08 09:29:23 -07:00
xianny
89ee6fe6db Updated CHANGELOGS 2019-08-08 09:29:08 -07:00
Fabio Berger
38a12475bc Update yarn.lock 2019-08-08 08:12:12 -07:00
Fabio Berger
9a800264a2 Update Lerna and fix private package issue 2019-08-08 08:04:58 -07:00
Xianny
8ce390be3c switch @0x/contract-wrappers to generated wrappers (#2037)
* switch @0x/contract-wrappers to generated wrappers

- remove TransactionEncoder
- move TokenUtils to @0x/dev-utils
- detailed changes in #2040
2019-08-08 07:29:30 -07:00
Jacob Evans
cc93532f4f Add Images for I Voted tokens 2019-08-08 14:32:26 +10:00
Jacob Evans
37cc40521c Remove solc-bin from npm publish 2019-08-08 11:51:22 +10:00
F. Eugene Aumson
5ac7ff7084 Generate wrappers for all contracts (#2010)
* abi-gen/Py: fix return type for multi-val returns

Methods that return multiple values were broken in two ways.  One: a
spurious newline was being injected between the return type and the
colon ending the Python method prototype.  Two: the return type was
being generated as just `[TypeA, TypeB]`, whereas it should be
`Tuple[TypeA, TypeB]`.

* abi-gen/Py: fix support for arrays of structs

* abi-gen/Py: FAILING test case nested unrefd struct

When a struct contains another struct, and the inner struct is not
directly referenced by any method interface, wrapper generation is
failing to render a class to represent the inner struct.

This won't fail in CI because at this time CI doesn't run any native
Python tooling to analyze the generated code.  Running mypy locally on
the files in this commit produces the following output:

test-cli/output/python/abi_gen_dummy/__init__.py:76: error: Name 'Tuple0x246f9407' is not defined

This problem affects the generation of wrappers for the DutchAuction
contract.

* abi-gen/Py: fix nested unref'd struct failure

* abi-gen/Py: introduce newlines to quiet linter

When generating contracts with long names (eg
CoordinatorRegistryValidator), the `black` reformatter was introducing
these newlines for us, and it was moving the `# type: ignore` comment in
there such that it no longer was on the line it needed to be on.
Introducing these newlines manually (instead of letting black inject
them) allows the linter directive to stay where it needs to be.

* abi-gen/Py: declare tuples in dependency order

* abi-gen/Py: fix support for overloaded methods

* contract_wrappers.py: pylint: permit 2-char args

By default pylint says that 2 characters is too short for an argument
name, but we have some contract methods with 2-character argument names
(eg `to` in `AssetProxyOwner.getTransactionIds()`), so we want to permit
them.

* contract_wrappers.py: include all contracts

* Update CHANGELOGs

* abi-gen: rename variable

* abi-gen: refine comments

* abi-gen/Py: reword tuple class docstring
2019-08-07 12:44:16 -04:00
Jacob Evans
e682b82ca8 Merge pull request #2021 from 0xProject/feat/1155-staticCall-proxies
1155 static call proxies
2019-08-07 09:34:25 +10:00
Xianny
7cd1fd0aaa Add devdocs to generated contract wrappers (#2013)
* first pass at including doc comments

* incorporate suggestions for method comments; add devdoc to dummy contract

* better formatting and persist generated docs as circleci build artifacts

* store artifacts properly

* hanging indent for method params
2019-08-06 14:24:08 -07:00
Jacob Evans
8cd99c5a40 Update Changelog 2019-08-06 17:26:49 +10:00
Jacob Evans
ad83312009 Update @0x/coordinator-server dependency 2019-08-06 09:50:10 +10:00
Jacob Evans
9e3b1fe333 Update to latest Coordinator Config 2019-08-06 09:45:41 +10:00
Jacob Evans
c3f42995f9 Update python addresses 2019-08-06 09:45:41 +10:00
Amir Bandeali
3d3a02c892 Add mainnet StaticCall and ERC1155Proxy addresses 2019-08-06 09:45:41 +10:00
Amir Bandeali
06bec227ad Add authorizedAddresses length check to MAP config tests 2019-08-06 09:45:40 +10:00
Amir Bandeali
5d7803323c Add script that tests deployed contract configs 2019-08-06 09:45:40 +10:00
Jacob Evans
4303f9a025 Add Ganache addresses to contract-addresses 2019-08-06 09:45:40 +10:00
Jacob Evans
fe4c5434fa Update migration 2019-08-06 09:45:40 +10:00
Amir Bandeali
9325bb70c5 Add testnet addresses 2019-08-06 09:45:39 +10:00
Amir Bandeali
b164557165 Add ERC1155Proxy and StaticCallProxy to build 2019-08-06 09:45:39 +10:00
Amir Bandeali
424f984ea8 Add ERC1155Proxy and StaticCallProxy artifacts 2019-08-06 09:45:39 +10:00
David Sun
78c704e3d1 Merge pull request #2032 from 0xProject/feature/asset-swapper/update-comments-info
Update comments for asset-swapper
2019-08-02 13:47:48 -07:00
Xianny
50f1a8fbd8 Add test for struct output in abi-gen (typescript) (#2028)
* add TS test for non-empty struct output
2019-08-02 13:34:19 -07:00
David Sun
0f90b7b5da Update comments for asset-swapper 2019-08-02 13:32:45 -07:00
David Sun
bec4384a5d Merge pull request #2030 from 0xProject/feature/website/change-credit-forms
Change modal contact form
2019-08-02 12:41:29 -07:00
David Sun
f361efae5a change modal contact form 2019-08-02 12:33:34 -07:00
Greg Hysz
76ca2116ab Merge pull request #2018 from 0xProject/feature/ContractWrappers/abiEncodeDecodeTxData
Decode Calldata + Return Values in Contract Wrappers
2019-08-02 09:51:01 +02:00
Greg Hysen
33d8646dc5 added start/end test comments to AbiGenDummy for consistency 2019-08-02 09:27:05 +02:00
F. Eugene Aumson
3cb5190bc6 Relax gas estimate expectation in Python doctest 2019-08-01 19:12:08 -04:00
Francesco Agosti
5bba06bef8 Merge pull request #2026 from 0xProject/feature/what_is_0x_video_embed
Add sandwich video to landing page
2019-08-01 14:27:30 -07:00
fragosti
dd3f672a35 Make video wider 2019-08-01 13:56:19 -07:00
fragosti
25ef3b8445 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/what_is_0x_video_embed 2019-08-01 13:43:33 -07:00
Greg Hysen
7eb2d290d8 Ran prettier 2019-08-01 20:25:19 +02:00
Greg Hysen
678762910b Fixed typo in callAsync.handlebars and updated expected output in abi-gen 2019-08-01 19:07:12 +02:00
Greg Hysen
da28a542c7 Added abi encoder test when bad selector is passed to method decoding 2019-08-01 19:07:12 +02:00
Greg Hysen
92602d33ad removed unnecessary fallback function from abi-gen tests 2019-08-01 19:07:12 +02:00
Greg Hysen
03f04f4bb3 Moved contract wrapper abi tests into abi-gen package 2019-08-01 19:07:12 +02:00
Greg Hysen
0d4dd5ff0d Appeased the linter 2019-08-01 19:05:22 +02:00
Greg Hysen
884864cc58 updated changelogs 2019-08-01 19:05:22 +02:00
Greg Hysen
7c199d83be updated expected output for abi-gen cli tests 2019-08-01 19:00:50 +02:00
Greg Hysen
5b4c29c4bb updated abi-gen-wrappers 2019-08-01 19:00:50 +02:00
Greg Hysen
f97ee80955 Added tests for strict decoding of method arguments 2019-08-01 19:00:50 +02:00
Greg Hysen
547322ae63 Do not allow allow reading beyond calldata 2019-08-01 19:00:50 +02:00
Greg Hysen
db74db622e Added getABIDecodedTransactionData and getABIDecodedReturnData to contract wrappers + test cases 2019-08-01 19:00:50 +02:00
F. Eugene Aumson
57318c0041 Python nested wrapper methods & estimate_gas (#1996)
* git rm unnecessary .gitkeep file

* After all Pytest runs, show short test summary

* abi-gen/Py: facilitate inlining of parameter lists

Effectively, stopped new-lines from being introduced by calls to the
`params` and `typed_params` partials.

* abi-gen: simple Py wrapper test for local dev'ment

* abi-gen/Py: stop gen'ing ValidatorBase

* abi-gen/Py: declare abi() wrapper method in Base

* abi-gen/Py: methods as classes to ease call/sendTx

Represent methods as classes in order to faciliate access to a method's
different operations (call, send_transaction, etc).

* contract_wrappers.py: make Base methods public

Changed some methods on BaseContractWrapper to be public.

* contract_wrappers.py: remove unused method

* contract_wrappers.py: extract method

* abi-gen/Py: inline method

* contract_wrappers.py: fix bug in call()

We were passing transaction parameters through to sendTransaction()
invocations, but not to call() invocations.

* abi-gen/Py: remove `view_only` param to call/tx

Formerly, in the BaseContractWrapper, there was just one function used
for both eth_call and eth_sendTransaction, and you would distinguish
between the two by specifying `view_only=True` when you wanted a call.

This commit defines a method dedicated to executing an eth_call, and
leaves the old method behind, with the `view_only` param removed, to be
used for eth_sendTransaction.

* abi-gen/Py: rename method

* contract_wrappers/Py: simplify web3 func handling

Pass web3 function instance into generated wrapper method class
constructor, rather than having that class obtain it upon each method
call.

Really this is just an elimination of a call to
BaseContractWrapper.contract_instance(), which will be removed
completely in a shortly-upcoming commit.

* contract_wrappers.py: inline method

Inline and remove method BaseContractWrapper.contract_instance().

* contract_wrappers.py: pass Validator to *Method

Pass a ValidatorBase instance into construction of the contract method
classes, *Method, to eliminate another dependency on the containing
contract object, which will be eliminated completely in a
shortly-upcoming commit.

* abi-gen/Py: BaseContractWrapper -> ContractMethod

Change the fundamental thing-to-be-wrapped from the contract to the
method.  Since the named method classes were introduced (in a previous
commit), and since the operations contained within the Base are
predominantly focused on supporting method calls more than anything
else, it makes more intuitive sense to provide a base for the methods
than for the contract.

With this change, the method classes no longer require a contract object
to be passed to their constructors.  The contract members that the
methods were utilizing are now passed directly to the method
constructor.

* contract_wrappers.py: rename module to bases...

...from _base_contract_wrapper.  The old name hasn't made sense since
ValidatorBase was moved into that module, and definitely doesn't make
sense now that the fundamental thing-to-be-wrapped has changed from the
contract to the method.  Also renamed to make it public (removed the
leading underscore) since we're generating code that will depend on it.

* abi-gen/Py: clarify call/sendTx docstrings

* abi-gen/Py: adjust whitespace

* contract_wrappers.py: inline method

* abi-gen/Py: rename class ValidatorBase...

...to just Validator.  It's in the "bases" module, which provides the
context needed in order to know it's a base class

* python-packages: fix silent failures of ./parallel

* contract_wrappers.py: remove private_key support

Having this present was overcomplicating interfaces.  And it was
untested (and not readily working when testing was attempted).  And it
only provided a thin layer of convenience, which a client could easily
code up themselves.

* contract_wrappers.py: inline method

* contract_wrappers.py: rm unused member variables

* contract_wrappers.py: rm unnecessary instance var

* abi-gen/Py: add estimate_gas to gen'd methods

* update CHANGELOG.json
2019-08-01 12:47:52 -04:00
fabioberger
4eb0767834 Update deps in private packages 2019-08-01 14:56:23 +02:00
fragosti
92bb7808ce Remove react-modal-video from website types 2019-07-31 17:50:21 -07:00
fragosti
abfe7d1613 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/what_is_0x_video_embed 2019-07-31 17:13:58 -07:00
fragosti
6c72239365 Remove react-modal-video as a dep and use the sass directly 2019-07-31 17:06:10 -07:00
fragosti
8001daad8c Fix linting errors 2019-07-31 16:40:39 -07:00
fragosti
73a38ab4f4 Add sandwich video to landing page 2019-07-31 15:15:55 -07:00
David Sun
281c207921 Publish
- @0x/contracts-asset-proxy@2.2.4
 - @0x/contracts-coordinator@2.0.9
 - @0x/contracts-dev-utils@0.0.6
 - @0x/contracts-exchange-forwarder@3.0.8
 - @0x/contracts-exchange@2.1.10
 - @0x/contracts-extensions@4.0.4
 - @0x/contracts-multisig@3.1.10
2019-07-31 14:14:47 -07:00
David Sun
ae531eef5f Updated CHANGELOGS 2019-07-31 14:14:35 -07:00
David Sun
d8b11238e6 reverted changelog for packages not published 2019-07-31 14:02:18 -07:00
David Sun
d36eb04ae8 Publish
- @0x/contracts-asset-proxy@2.2.4
 - @0x/contracts-coordinator@2.0.9
 - @0x/contracts-dev-utils@0.0.6
 - @0x/contracts-erc1155@1.1.11
 - @0x/contracts-erc20@2.2.10
 - @0x/contracts-erc721@2.1.11
 - @0x/contracts-exchange-forwarder@3.0.8
 - @0x/contracts-exchange-libs@3.0.4
 - @0x/contracts-exchange@2.1.10
 - @0x/contracts-extensions@4.0.4
 - @0x/contracts-multisig@3.1.10
 - @0x/contracts-test-utils@3.1.12
 - @0x/contracts-utils@3.2.0
 - 0x.js@6.0.14
 - @0x/abi-gen-templates@2.4.0
 - @0x/abi-gen-wrappers@5.1.0
 - @0x/abi-gen@3.1.2
 - @0x/assert@2.1.2
 - @0x/asset-buyer@6.1.10
 - @0x/asset-swapper@1.0.0
 - @0x/base-contract@5.3.0
 - @0x/connect@5.0.15
 - @0x/contract-artifacts@2.0.3
 - @0x/contract-wrappers@10.1.0
 - @0x/contracts-gen@1.0.12
 - @0x/dev-utils@2.2.6
 - @0x/fill-scenarios@3.0.15
 - @0x/json-schemas@3.1.12
 - @0x/migrations@4.1.11
 - @0x/order-utils@8.2.4
 - @0x/order-watcher@4.0.16
 - @0x/sol-compiler@3.1.11
 - @0x/sol-coverage@3.0.8
 - @0x/sol-doc@2.0.15
 - @0x/sol-profiler@3.1.10
 - @0x/sol-trace@2.0.16
 - @0x/sol-tracing-utils@6.0.15
 - @0x/sra-spec@2.0.13
 - @0x/subproviders@5.0.0
 - @0x/utils@4.4.2
 - @0x/web3-wrapper@6.0.9
2019-07-31 13:36:00 -07:00
David Sun
b97ba35279 Updated CHANGELOGS 2019-07-31 13:35:49 -07:00
David Sun
46efe92a72 Merge pull request #2025 from 0xProject/feature/asset-swapper/remove-react-deprecated
Removed react-docs from asset_swapper
2019-07-31 10:39:21 -07:00
David Sun
9cc27c7d1b Removed react-docs from asset_swapper 2019-07-31 10:14:31 -07:00
David Sun
7d3396f9c5 Merge pull request #2015 from 0xProject/feature/asset-swapper/bump-to-1.0.0
Version bump for asset-buyer and docs prep 1.0.0
2019-07-30 17:31:31 -07:00
David Sun
918ef13714 details 2019-07-30 16:48:46 -07:00
David Sun
9d12462893 updated comments in SwapQuoter 2019-07-30 12:25:58 -07:00
David Sun
ed44e16a95 prettier 2019-07-30 10:47:58 -07:00
Jan-Gerrit Harms
11e2fc5bc4 Added documentation for additional parameters 2019-07-30 15:18:08 +02:00
Jan-Gerrit Harms
3e88f820b8 Prettified changelog 2019-07-30 15:11:24 +02:00
Jan-Gerrit Harms
163750f8c2 Updated internal usages of isValidSignatureAsync 2019-07-30 14:52:35 +02:00
Jan-Gerrit Harms
4aabc5d791 Fixed merge conflict in changelog 2019-07-30 14:43:24 +02:00
Jan-Gerrit Harms
c9a7b9dcc1 Appended to changelog in the order-utils package 2019-07-30 14:35:11 +02:00
Jan-Gerrit Harms
98075b5653 Revert "Updated changelog"
This reverts commit 57ae5be916.
2019-07-30 14:32:27 +02:00
Jan-Gerrit Harms
57ae5be916 Updated changelog 2019-07-30 14:26:46 +02:00
Jan-Gerrit Harms
8caf62997f Forgot formatting again 2019-07-30 13:26:27 +02:00
Jan-Gerrit Harms
f8656ad376 Added integration tests and fixed another bug 2019-07-30 13:25:36 +02:00
Jan-Gerrit Harms
29c6c2a2ad Add exports to 0x.js 2019-07-30 10:15:41 +02:00
Fabio B
dadab94644 Merge pull request #2004 from 0xProject/fix/githubDepsIssue
Fix react-highlight dep issue
2019-07-30 09:56:43 +02:00
Jan-Gerrit Harms
f2db67ef02 Fixed prettier errors 2019-07-30 09:50:54 +02:00
David Sun
7ec232a470 bumped version and added to docs 2019-07-29 18:42:24 -07:00
David Sun
dc3569392c updated changelog 2019-07-29 17:07:16 -07:00
David Sun
11999cd407 Merge pull request #2011 from 0xProject/feature/asset-swapper/renaming-to
Asset swapper renaming to -> toAddress
2019-07-29 15:48:31 -07:00
David Sun
f786f8a7f6 renaming to -> toAddress 2019-07-29 14:43:51 -07:00
fabioberger
aab39e6ae0 Use explicit URL form for Github dependencies with commit hash to avoid Yarn caching issue 2019-07-29 22:40:31 +02:00
Fabio B
31d3968649 Merge pull request #1993 from 0xProject/remove/reactDocsAndReactShared
Remove react-docs and react-shared packages
2019-07-29 22:37:52 +02:00
Jan-Gerrit Harms
72b8ef33d9 Fixes #1998, still needs Integration testing 2019-07-29 21:39:21 +02:00
David Sun
2cd0b01019 Merge pull request #2009 from 0xProject/feature/website/remove-zeip-vote-banner
Removed Banner
2019-07-29 11:29:32 -07:00
David Sun
a6bc0db896 removed banner 2019-07-29 11:24:47 -07:00
Greg Hysz
7cba95b523 Merge pull request #1995 from 0xProject/feature/ContractWrappers/decodeLogArgs
Decode log arguments in `awaitTransactionSuccessAsync`
2019-07-29 20:23:36 +02:00
David Sun
1b976130ce Merge pull request #1980 from 0xProject/feature/asset-swapper/add-test-coverage
Add test coverage for asset-swapper
2019-07-29 11:20:36 -07:00
David Sun
e9babc5a94 prettier + lint 2019-07-29 10:52:58 -07:00
David Sun
c8d0ff846c Finished up adding test coverage 2019-07-29 10:52:58 -07:00
David Sun
db1e9769d0 Fixed testing bug 2019-07-29 10:52:58 -07:00
David Sun
4b038b07ed changes for testing 2019-07-29 10:52:58 -07:00
David Sun
4c17c142f9 ground work for forwarder consumer 2019-07-29 10:52:58 -07:00
David Sun
65b2fa13ac added coverage for swap quote calculator 2019-07-29 10:52:58 -07:00
David Sun
c375199daa add affiliate fee utils tests 2019-07-29 10:52:58 -07:00
David Sun
805131cf1e add affiliate fee utils 2019-07-29 10:52:58 -07:00
Greg Hysen
6f64115561 Switched assignment of logDecodeDependenciesAbiOnly for readability and to pass linter 2019-07-29 17:51:56 +02:00
Greg Hysen
0aadb789a5 Fixed linter errors 2019-07-29 16:45:13 +02:00
Greg Hysen
26ee4d626c ran prettier on abi-gen-wrappers 2019-07-29 15:57:59 +02:00
Greg Hysen
a8939d3eda Updated expected typescript output for abi-gen cli tests 2019-07-29 12:28:28 +02:00
Greg Hysen
048e48b03a updated contract wrappers 2019-07-29 12:24:19 +02:00
Greg Hysen
c2f34baee0 Changed artifactDependencies/abiDependencies to logDecodeDependencies + removed lodash depency in contract wrappers 2019-07-29 12:19:35 +02:00
Greg Hysen
8961b476ef fixed typo in a test 2019-07-29 12:19:35 +02:00
Greg Hysen
58e08335b5 Added another test to show what happens when decoding both local and downstream events 2019-07-29 12:19:35 +02:00
Greg Hysen
ea8fc1d93f updated test output from abi-gen to account for changes to deployFrom0xArtifactAsync and deployAsync 2019-07-29 12:19:35 +02:00
Greg Hysen
2968dfb2ae Minor readability improvements 2019-07-29 12:14:37 +02:00
Greg Hysen
24783107ba Updated generated contract wrappers and ran linter 2019-07-29 12:11:58 +02:00
Greg Hysen
365c056b0f Added tests for for decoding log arguments when artifact dependencies are included/excluded 2019-07-29 12:11:02 +02:00
Greg Hysen
88a7d9cca8 Updated changelogs for deployFrom0xArtifactAsync interface change 2019-07-29 12:11:02 +02:00
Greg Hysen
d8cf9d54aa Updated all instances of deployFrom0xArtifactAsync 2019-07-29 12:07:28 +02:00
Greg Hysen
df746c5ff4 Decode log arguments in awaitTransactionSuccessAsync, when ABI is recognized. 2019-07-29 12:04:37 +02:00
Fabio B
aa29526ae4 Merge pull request #2003 from 0xProject/updateLodash
Update lodash
2019-07-29 00:57:16 +02:00
fabioberger
f0b5616aba Use more explicit URL dep pinning to avoid yarn cache issue with Github deps 2019-07-27 16:14:51 +02:00
fabioberger
2eca95df00 Fix version test 2019-07-27 15:35:39 +02:00
fabioberger
f560c2e66a stop exporting removed EthLightwalletSubprovider 2019-07-27 14:52:10 +02:00
fabioberger
5e19496e32 Update as many lodash deps to higher versions 2019-07-27 14:45:20 +02:00
fabioberger
aeadaba005 update publish-release fork again with updated inquirer dep 2019-07-27 14:41:46 +02:00
fabioberger
8dfda9ffdd Update publish-release fork to version with v4 lodash dep 2019-07-27 14:38:05 +02:00
fabioberger
91992bb034 Update ganache-core 2019-07-27 14:37:50 +02:00
fabioberger
34a93857a0 Remove eth-lighwallet subprovider 2019-07-27 14:34:10 +02:00
fabioberger
fbda096aa9 Fix linter errors 2019-07-27 14:13:20 +02:00
fabioberger
24a26aef70 Remove remaining references to react-shared 2019-07-27 14:13:20 +02:00
fabioberger
ec7f9d8a63 Remove react-shared package and fold it into website 2019-07-27 14:13:20 +02:00
fabioberger
cc7dec7a99 Move react-docs into website and delete it as a standalone package 2019-07-27 14:12:57 +02:00
Xianny
46384ce80d Allow generated wrappers to subscribe/unsubscribe to events (#1970)
* Define SubscriptionManager and instantiate in generated wrappers

* expose subscribe/unsubscribe in generated wrappers

* update changelogs

* use SubscriptionManager in `@0x/contract-wrappers`
2019-07-26 16:54:31 -07:00
F. Eugene Aumson
5aeb626045 abi-gen: skip run_mocha on OSX (#2002) 2019-07-26 13:28:32 -04:00
David Sun
d2a27f1a48 Merge pull request #1983 from 0xProject/feature/website/alex-towle
Adding Alex Towle to team page
2019-07-26 09:51:54 -07:00
Fabio B
f07c67202f Merge pull request #1999 from 0xProject/upgradeMocha
Update Mocha & Chokidar Deps
2019-07-26 18:39:54 +02:00
fabioberger
3a3658708a Get all Mocha's on same version and add typings to all packages 2019-07-26 18:05:57 +02:00
fabioberger
f3c5d19246 Update remaining handlebars of deps of deps 2019-07-26 17:42:59 +02:00
fabioberger
c66d8f202a Update Mocha 2019-07-26 17:38:44 +02:00
Fabio B
ec641c171d Merge pull request #1994 from 0xProject/fix/upgradeDeps
Update dependencies
2019-07-26 14:50:57 +02:00
David Sun
773d624365 Merge pull request #1997 from 0xProject/feature/asset-swapper/fix-changelog
Asset-swapper fix changelog
2019-07-25 15:18:18 -07:00
David Sun
25bd97a014 updated changelog 2019-07-25 14:49:34 -07:00
fabioberger
5dd9e28f72 Fix handlebar header callbacks now that the typings changed 2019-07-25 12:24:44 +02:00
fabioberger
cc1ef6f268 Update handlebars dep 2019-07-25 11:42:23 +02:00
fabioberger
967e361da3 Use https for all registry URLs 2019-07-25 11:40:13 +02:00
fabioberger
398097900c Fix test-publish CI test when no packages exist to publish 2019-07-25 11:30:55 +02:00
fabioberger
b86473f3c7 Update yarn.lock 2019-07-24 22:33:27 +02:00
fabioberger
3d361c6b4a Special-case if there are no packages to publish 2019-07-24 22:33:12 +02:00
fabioberger
3346024ea7 Upgrade lerna fork to fix test-publish failure 2019-07-24 22:20:09 +02:00
Fabio B
2fecf6c80b Merge pull request #1982 from 0xProject/fix/enableLerna2FAPrompt
publishing: prompt user for OTP
2019-07-24 20:27:24 +02:00
David Sun
183b4fb7ee Merge pull request #1988 from 0xProject/feature/asset-swapper/optimized-market-sell-output
Added optimization utils for asset-swapper exchange consumer
2019-07-24 11:09:15 -07:00
David Sun
0e2afc5dcb Merge pull request #1985 from 0xProject/feature/asset-swapper/update-changelog
Updated CHANGELOG.json for asset-swapper
2019-07-24 11:04:47 -07:00
David Sun
91aa716c07 prettier and lint 2019-07-24 10:46:22 -07:00
David Sun
9977626de0 Switched NULL_ADDRESS to NULL_BYTES 2019-07-24 10:46:22 -07:00
David Sun
8bb3fb5bb3 added optimization utils 2019-07-24 10:46:22 -07:00
David Sun
6d7adb277e prettier 2019-07-24 10:42:52 -07:00
fabioberger
fef1bd13b5 Add HACK comment about writing cdVersions to a file 2019-07-24 19:38:46 +02:00
fabioberger
910bba9976 Bump Lerna fork version to include change of cdVersions flag to file path and separator to | between package versions 2019-07-24 19:38:46 +02:00
fabioberger
cd2d756717 Use spawn instead of exec so we can intercept any 2FA requests and bubble them to the user 2019-07-24 19:38:46 +02:00
fabioberger
0a47d89963 Use spawn instead of exec so we can bubble up the OTP prompt since OTP is only valid for 30sec, and we might need several 2019-07-24 19:38:46 +02:00
fabioberger
65e5b09cd1 Fix outdated versions of monorepo dependencies 2019-07-24 19:23:05 +02:00
Fabio Berger
6f3cee1a1e Publish
- @0x/contracts-asset-proxy@2.2.3
 - @0x/contracts-coordinator@2.0.8
 - @0x/contracts-dev-utils@0.0.5
 - @0x/contracts-erc1155@1.1.10
 - @0x/contracts-erc20@2.2.9
 - @0x/contracts-erc721@2.1.10
 - @0x/contracts-exchange-forwarder@3.0.7
 - @0x/contracts-exchange-libs@3.0.3
 - @0x/contracts-exchange@2.1.9
 - @0x/contracts-extensions@4.0.3
 - @0x/contracts-multisig@3.1.9
 - @0x/contracts-test-utils@3.1.11
 - @0x/contracts-utils@3.1.10
 - 0x.js@6.0.13
 - @0x/abi-gen-templates@2.3.0
 - @0x/abi-gen-wrappers@5.0.3
 - @0x/abi-gen@3.1.1
 - @0x/assert@2.1.1
 - @0x/asset-buyer@6.1.9
 - @0x/asset-swapper@0.0.5
 - @0x/base-contract@5.1.2
 - @0x/connect@5.0.14
 - @0x/contract-artifacts@2.0.2
 - @0x/contract-wrappers@9.1.8
 - @0x/contracts-gen@1.0.11
 - @0x/dev-utils@2.2.5
 - ethereum-types@2.1.4
 - @0x/fill-scenarios@3.0.14
 - @0x/json-schemas@3.1.11
 - @0x/migrations@4.1.10
 - @0x/order-utils@8.2.3
 - @0x/order-watcher@4.0.15
 - @0x/react-docs@2.0.15
 - @0x/react-shared@2.0.15
 - @0x/sol-compiler@3.1.10
 - @0x/sol-coverage@3.0.7
 - @0x/sol-doc@2.0.14
 - @0x/sol-profiler@3.1.9
 - @0x/sol-resolver@2.0.9
 - @0x/sol-trace@2.0.15
 - @0x/sol-tracing-utils@6.0.14
 - @0x/sra-spec@2.0.12
 - @0x/subproviders@4.1.2
 - @0x/types@2.4.1
 - @0x/typescript-typings@4.2.4
 - @0x/utils@4.4.1
 - @0x/web3-wrapper@6.0.8
2019-07-24 01:50:18 -07:00
Fabio Berger
c43d4bbf71 Updated CHANGELOGS 2019-07-24 01:50:00 -07:00
Jacob Evans
b7337410aa Fix Vote router link root 2019-07-24 17:27:46 +10:00
David Sun
10b7d7da3f Merge pull request #1984 from 0xProject/feature/website/add-vote-faq
Add FAQ link to vote page
2019-07-23 10:28:50 -07:00
David Sun
97a8c6e5af Updated CHANGELOG.json 2019-07-23 10:27:55 -07:00
David Sun
e69d2bb54a Add FAQ link to vote page 2019-07-23 10:06:39 -07:00
F. Eugene Aumson
ead8099109 Auto-gen Python Exchange wrapper (#1919)
* Rename existing wrapper, to match contract name

* base contract: make member var public

* json_schemas.py: stop storing copies of schemas!

* .gitignore generated erc20_token.py wrapper

* json schemas: allow uppercase digits in address

* existing exchange wrapper: re-order methods

to match method order in Solidity contract, to reduce noise in upcoming
diffs of newly generated code vs. old manually-written code.

* existing exchange wrapper: rename method params

To match contract method param names

* existing exchange wrapper: remove redundant member

* existing exchange wrapper: make signatures bytes

Not strings.

* abi-gen/test-cli: show context on diff failure

* abi-gen-templates/Py: fix broken event interface

Previous changes had removed the `token_address` parameter from all
generated methods, but this instance was missed because there weren't
tests/examples using events for the first contract for which wrappers
were generated (ERC20Token).

* abi-gen: remove unused method parameters

* abi-gen: convert Py method params to snake case

* abi-gen: rewrite Python tuple handling

* python-generated-wrappers: include Exchange

* abi-gen-templates/Py: easy linter fixes

* abi-gen-templates/Py: satisfy docstring linters

* abi-gen-templates/Py: normalize bytes before use

* contract_wrappers.py: replace Exchange w/generated

* contract_wrappers.py: rm manually written Exchange

* contract_wrappers.py/doctest: rename variables

* abi-gen: fix misspelling in docstring

Co-Authored-By: Fabio B <me@fabioberger.com>

* Py docs: error on warning, and test build in CI

* abi-gen: doc Py bytes params as requiring UTF-8

* abi-gen: git mv diff.sh test-cli/

* abi-gen: put Py wrapper in module folder, not file

This leaves space for user-defined additions to the same module, such as
for custom types, as shown herein.

* abi-gen: customizable param validation for Python

* contract_wrappers.py: JSON schema Order validation

* CircleCI Build Artifacts

For abi-gen command-line test output, for generated Python contract
wrappers as output by abi-gen, for generated Python contract wrappers as
reformatted and included in the Python package area, and for the "build"
output folder in each Python package, which includes the generated
documentation.

* CHANGELOG updates for all components

* abi-gen: grammar in comments

Co-Authored-By: Fabio B <me@fabioberger.com>

* abi-gen: CHANGELOG spelling correction

Co-Authored-By: Fabio B <me@fabioberger.com>

* order_utils.py: reverse (chronological) CHANGELOG

* abi-gen-templates: reset CHANGELOG patch version

* CHANGELOGs: use multiple entries where appropriate

* abi-gen: enable devdoc solc output in test-cli

* abi-gen-templates/Py: consolidate return type

* abi-gen/test-cli: non-pure fixture contract method

Added a method to the "dummy" test fixture contract that isn't pure.
All of the other prior method cases were pure.

* abi-gen/Py: fix const methods missing return type

* abi-gen/Py: fix wrong return types on some methods

Specifically, wrapper methods wrapping contract methods that modify
contract state and return no return value.  There was no test case for
this.  Now there is.

* contract_wrappers.py: rm generated code in `clean`

* Parallelize Py monorepo scripts (test, lint, etc)
2019-07-23 12:58:18 -04:00
Chris Kalani
9d455b2bca Adding Alex Towle to team page 2019-07-23 16:19:27 +02:00
Jacob Evans
1e6e74878f Merge pull request #1981 from 0xProject/fix/vote-copy
Update vote copy
2019-07-23 21:03:10 +10:00
Fabio Berger
cbcede3b63 Add missing backslash that is part of registry URL comparison in Lerna 2019-07-23 04:01:17 -07:00
Jacob Evans
98fd731485 Added SVGs for voting 2019-07-23 18:09:10 +10:00
Jacob Evans
9ca319b4ea Update vote copy 2019-07-23 15:25:02 +10:00
Fabio B
ff8fabf49e Merge pull request #1979 from 0xProject/fix/updateLerna
Update Lerna fork to latest version
2019-07-23 00:07:55 +02:00
fabioberger
1e00f68941 Update Lerna version and make necessary changes to accomodate the new version 2019-07-22 23:23:11 +02:00
David Sun
6c79edd3b2 Merge pull request #1978 from 0xProject/feature/website/add-FAQ-annoucement
Add announcement for vote
2019-07-22 14:08:26 -07:00
David Sun
b79bc6bab9 add announcement 2019-07-22 12:45:46 -07:00
Fabio B
c59d886662 Merge pull request #1974 from 0xProject/removeMetacoin
Remove metacoin example from monorepo
2019-07-19 22:02:38 +02:00
fabioberger
e39dce6159 Remove metacoin example from monorepo 2019-07-19 19:38:08 +02:00
Fabio B
620c66fb4c Merge pull request #1972 from 0xProject/fix/deprecateOrderWatcher
Deprecate @0x/order-watcher
2019-07-19 19:35:21 +02:00
F. Eugene Aumson
3af91d54cb Delete pipeline.env.gpg 2019-07-19 13:06:21 -04:00
fabioberger
1fe1bcff98 Stop publishing new order watcher versions to Docker Hub 2019-07-19 17:50:12 +02:00
fabioberger
c58c12c5b3 Add deprecation warnings for @0x/order-watcher 2019-07-19 17:49:57 +02:00
Jacob Evans
1aeea39eb3 Merge pull request #1967 from bstchow/issue-1945-fix
[Issue #1945] Downcase address comparison in private_key_wallet.ts in subproviders module
2019-07-18 10:57:27 +10:00
David Sun
d3fbf020de Merge pull request #1966 from 0xProject/feature/asset-swapper/expanding-options-utils
Added options, features for asset-swapper
2019-07-17 15:43:05 -07:00
David Sun
8ce8bee76f prettier + lint 2019-07-17 15:22:48 -07:00
David Sun
dcf4eb2aaf utils moved to SwapQuoter and polished Doc Strings 2019-07-17 15:12:59 -07:00
David Sun
88ff38eca6 fixed build issues 2019-07-17 13:38:30 -07:00
David Sun
bf0d90d079 added options, features for asset-swapper 2019-07-17 11:56:27 -07:00
Amir Bandeali
c4d9ef9f83 Merge pull request #1964 from 0xProject/feature/contracts/consistentErrorCodes
Update MAP + add validation to assetDataUtils
2019-07-17 11:15:11 -07:00
Xianny
37bce53683 Normalize address inputs to lowercase in generated wrappers (#1951) 2019-07-17 10:13:28 -07:00
Amir Bandeali
05d50b62c9 Update CHANGELOG 2019-07-17 09:37:42 -07:00
Amir Bandeali
eb2fb7f790 Fix linting error 2019-07-17 09:37:42 -07:00
Amir Bandeali
d280ccb3c4 Add better validation to assetDataUtils 2019-07-17 09:37:42 -07:00
Amir Bandeali
a569815840 Fix assetData length check and improve readability 2019-07-17 09:37:42 -07:00
Greg Hysen
9e41c3093b Conforming to error codes in ERC1155 Proxy 2019-07-17 09:37:42 -07:00
Amir Bandeali
9dbc9a8ad9 Merge pull request #1963 from 0xProject/feat/contracts/non-asm-proxies
Implement ERC1155Proxy and StaticCallProxy in Solidity
2019-07-17 09:23:25 -07:00
Jacob Evans
c940157814 Merge pull request #1908 from 0xProject/feature/vote_index_page
Implement the vote index page
2019-07-17 18:27:09 +10:00
Jacob Evans
4f19875a58 Remove commented routes 2019-07-17 15:17:54 +10:00
Jacob Evans
dcbadb2386 Update Vote form 2019-07-17 15:04:33 +10:00
Jacob Evans
405a7b2037 Update dates to 22nd July 2019-07-17 15:04:33 +10:00
Jacob Evans
e69ad24737 Update ZEIP-ID propagation 2019-07-17 15:04:32 +10:00
Jacob Evans
a31056a4ec Fix PR comments 2019-07-17 15:04:32 +10:00
Jacob Evans
d41dddddcd Update subheader copy 2019-07-17 15:04:32 +10:00
Jacob Evans
251ae50d3e Update copy, fetch data 2019-07-17 15:04:32 +10:00
fragosti
4ccd2d4955 Comment out route and replace with redirect 2019-07-17 15:04:31 +10:00
fragosti
dfb79e0998 Remove Zeip type, use zeip id in governance page CTA 2019-07-17 15:04:31 +10:00
fragosti
590055e2ba Fix date formatting 2019-07-17 15:04:31 +10:00
fragosti
f388751a97 Implement the vote index page with routing to voting pages 2019-07-17 15:04:31 +10:00
Amir Bandeali
53136caaa4 Add test for when staticCallTarget is an EOA 2019-07-16 16:00:38 -07:00
David Sun
dd20d8d6de Merge pull request #1959 from 0xProject/feature/asset-swapper/minor-changes
Minor changes to Asset-swapper
2019-07-16 13:05:25 -07:00
Xianny
a977957946 Require compiler field in published artifacts for v3 (#1961) 2019-07-16 12:25:08 -07:00
David Sun
8974fcabe3 Prettier 2019-07-16 11:03:00 -07:00
Brandon Chow
aff8e1e025 Remove the timestamp from subproviders CHANGELOG.json (should be automatically added) and run 'yarn prettier' to format changes. 2019-07-16 09:51:18 -07:00
Amir Bandeali
10d767c5ab Update ERC1155Proxy tests 2019-07-15 22:08:23 -07:00
Amir Bandeali
77484dc69e Implement ERC1155Proxy in Solidity 2019-07-15 22:08:08 -07:00
Amir Bandeali
185e2342d9 Update StaticCallProxy tests 2019-07-15 22:07:31 -07:00
Amir Bandeali
54f4727adc Implement StaticCallProxy in Solidity 2019-07-15 22:07:15 -07:00
Brandon Chow
6e0f982163 Downcase addresses when checking for address equality in signTransactionAsync in the private key subprovider 2019-07-15 18:35:05 -07:00
Brandon Chow
43072ef80d Add test for checksummed addresses being valid inputs for tx origin when calling signTransactionAsync in the private key subprovider 2019-07-15 18:33:33 -07:00
David Sun
7618e63f49 expanded constants 2019-07-15 15:53:06 -07:00
David Sun
542255332d changed market-operation type to enum from literal 2019-07-15 15:29:13 -07:00
David Sun
6d6e7e1468 Merge pull request #1958 from 0xProject/feature/asset-swapper/package-readme.md-update
Updated README.md for asset-swapper
2019-07-15 15:09:01 -07:00
David Sun
0ff88d5c21 fix typo 2019-07-15 14:26:04 -07:00
David Sun
092e35bae3 updated README.md 2019-07-15 14:17:41 -07:00
Fabio Berger
ac82b2622c Publish
- 0x.js@6.0.12
 - @0x/abi-gen-wrappers@5.0.2
 - @0x/asset-buyer@6.1.8
 - @0x/asset-swapper@0.0.4
 - @0x/connect@5.0.13
 - @0x/contract-addresses@3.0.2
 - @0x/contract-wrappers@9.1.7
 - @0x/fill-scenarios@3.0.13
 - @0x/instant@1.0.27
 - @0x/metacoin@0.0.54
 - @0x/migrations@4.1.9
 - @0x/order-utils@8.2.2
 - @0x/order-watcher@4.0.14
 - @0x/testnet-faucets@1.0.83
 - @0x/website@0.0.86
 - @0x/contracts-asset-proxy@2.2.2
 - @0x/contracts-coordinator@2.0.7
 - @0x/contracts-dev-utils@0.0.4
 - @0x/contracts-erc1155@1.1.9
 - @0x/contracts-erc20@2.2.8
 - @0x/contracts-erc721@2.1.9
 - @0x/contracts-exchange@2.1.8
 - @0x/contracts-exchange-forwarder@3.0.6
 - @0x/contracts-exchange-libs@3.0.2
 - @0x/contracts-extensions@4.0.2
 - @0x/contracts-multisig@3.1.8
 - @0x/contracts-test-utils@3.1.10
 - @0x/contracts-utils@3.1.9
2019-07-15 05:23:02 -07:00
Fabio Berger
7197cb57cd Updated CHANGELOGS 2019-07-15 05:22:51 -07:00
Fabio B
030d66cb63 Merge pull request #1955 from 0xProject/feature/contract-addresses/order-validator-2.1
Redeploy OrderValidator on testnets and update addresses
2019-07-15 13:34:34 +02:00
F. Eugene Aumson
d414e6a7c4 0x-contract-addresses.py: changelog for redeploy 2019-07-15 02:26:07 -04:00
Amir Bandeali
30f9c94620 Redeploy OrderValidator on testnets and update addresses 2019-07-13 21:07:52 -07:00
Fabio Berger
b6b618e5ce Publish
- 0x.js@6.0.11
 - @0x/abi-gen@2.1.1
 - @0x/abi-gen-wrappers@5.0.1
 - @0x/asset-buyer@6.1.7
 - @0x/asset-swapper@0.0.3
 - @0x/connect@5.0.12
 - @0x/contract-addresses@3.0.1
 - @0x/contract-wrappers@9.1.6
 - @0x/dev-tools-pages@0.0.29
 - @0x/fill-scenarios@3.0.12
 - @0x/instant@1.0.26
 - @0x/metacoin@0.0.53
 - @0x/migrations@4.1.8
 - @0x/order-utils@8.2.1
 - @0x/order-watcher@4.0.13
 - @0x/python-contract-wrappers@1.0.2
 - @0x/react-docs@2.0.14
 - @0x/react-shared@2.0.14
 - @0x/testnet-faucets@1.0.82
 - @0x/website@0.0.85
 - @0x/contracts-asset-proxy@2.2.1
 - @0x/contracts-coordinator@2.0.6
 - @0x/contracts-dev-utils@0.0.3
 - @0x/contracts-erc1155@1.1.8
 - @0x/contracts-erc20@2.2.7
 - @0x/contracts-erc721@2.1.8
 - @0x/contracts-exchange@2.1.7
 - @0x/contracts-exchange-forwarder@3.0.5
 - @0x/contracts-exchange-libs@3.0.1
 - @0x/contracts-extensions@4.0.1
 - @0x/contracts-multisig@3.1.7
 - @0x/contracts-test-utils@3.1.9
 - @0x/contracts-utils@3.1.8
2019-07-13 13:00:33 -07:00
Fabio Berger
0bb8887027 Updated CHANGELOGS 2019-07-13 13:00:21 -07:00
Fabio B
fabfdd0aa2 Merge pull request #1954 from 0xProject/fix/updateRemainingV2Addresses
Update remaining V2.1 contract address changes
2019-07-13 21:27:36 +02:00
fabioberger
8f8336b344 Fix version issues causing CI to fail 2019-07-13 21:04:16 +02:00
fabioberger
d10659f986 Update remaining V2.1 contract address changes 2019-07-13 20:25:47 +02:00
822 changed files with 77953 additions and 22074 deletions

View File

@@ -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
@@ -33,10 +38,16 @@ jobs:
key: python-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/python-contract-wrappers/generated
- store_artifacts:
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:
@@ -44,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:
@@ -54,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:
@@ -67,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:
@@ -77,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:
@@ -86,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:
@@ -102,9 +114,7 @@ jobs:
- run: yarn wsrun test:circleci @0x/contract-wrappers
- run: yarn wsrun test:circleci @0x/dev-utils
- run: yarn wsrun test:circleci @0x/json-schemas
- run: yarn wsrun test:circleci @0x/metacoin
- run: yarn wsrun test:circleci @0x/order-utils
- run: yarn wsrun test:circleci @0x/order-watcher
- run: yarn wsrun test:circleci @0x/sol-compiler
- run: yarn wsrun test:circleci @0x/sol-tracing-utils
- run: yarn wsrun test:circleci @0x/sol-doc
@@ -144,18 +154,10 @@ jobs:
key: coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/json-schemas/coverage/lcov.info
- save_cache:
key: coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/metacoin/coverage/lcov.info
- save_cache:
key: coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/order-utils/coverage/lcov.info
- save_cache:
key: coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/order-watcher/coverage/lcov.info
- save_cache:
key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
paths:
@@ -179,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:
@@ -209,7 +210,8 @@ jobs:
- run:
command: |
cd python-packages
./cmd_pkgs_in_dep_order.py 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 }}
paths:
@@ -234,14 +236,30 @@ jobs:
key: coverage-python-sra-client-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/python-packages/sra_client/.coverage
- store_artifacts:
path: ~/repo/python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_token/__init__.py
- store_artifacts:
path: ~/repo/python-packages/contract_wrappers/src/zero_ex/contract_wrappers/exchange/__init__.py
- store_artifacts:
path: ~/repo/python-packages/contract_addresses/build
- store_artifacts:
path: ~/repo/python-packages/contract_artifacts/build
- store_artifacts:
path: ~/repo/python-packages/contract_wrappers/build
- store_artifacts:
path: ~/repo/python-packages/json_schemas/build
- store_artifacts:
path: ~/repo/python-packages/middlewares/build
- store_artifacts:
path: ~/repo/python-packages/order_utils/build
- store_artifacts:
path: ~/repo/python-packages/sra_client/build
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:
@@ -265,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:
@@ -284,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:
@@ -296,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:
@@ -326,15 +342,9 @@ jobs:
- restore_cache:
keys:
- coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}

3
.gitattributes vendored
View File

@@ -3,5 +3,6 @@
# Automatically collapse generated files in GitHub.
*.svg linguist-generated=true
packages/contract-artifacts/artifacts/*json linguist-generated=true
packages/abi-gen-wrappers/src/generated-wrappers/*.ts liguist-generated=true
packages/abi-gen-wrappers/src/generated-wrappers/*.ts linguist-generated=true
packages/contract-wrappers/src/generated-wrappers/*.ts linguist-generated=true

View File

@@ -21,16 +21,12 @@ 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']
0x.js: ['packages/0x.js']
@0x/abi-gen-wrappers: ['packages/abi-gen-wrappers']
@0x/metacoin: ['packages/metacoin']
@0x/contract-artifacts: ['packages/contract-artifacts']
@0x/dev-utils: ['packages/dev-utils']
@0x/contract-wrappers: ['packages/contract-wrappers']

29
.gitignore vendored
View File

@@ -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/
@@ -96,7 +95,6 @@ contracts/extensions/generated-artifacts/
contracts/exchange-forwarder/generated-artifacts/
contracts/dev-utils/generated-artifacts/
packages/sol-tracing-utils/test/fixtures/artifacts/
packages/metacoin/artifacts/
python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/
# generated contract wrappers
@@ -114,10 +112,26 @@ contracts/erc1155/generated-wrappers/
contracts/extensions/generated-wrappers/
contracts/exchange-forwarder/generated-wrappers/
contracts/dev-utils/generated-wrappers/
packages/metacoin/src/contract_wrappers
# cli test output
packages/abi-gen/test-cli/output
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
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/
@@ -134,3 +148,6 @@ python-packages/*/dist
__pycache__
python-packages/*/src/*.egg-info
python-packages/*/.coverage
# python keeps package-local copies of json schemas
python-packages/json_schemas/src/zero_ex/json_schemas/schemas

View File

@@ -27,8 +27,6 @@ lib
/packages/abi-gen/test-cli/output
/packages/json-schemas/schemas
/python-packages/json_schemas/src/zero_ex/json_schemas/schemas
/packages/metacoin/src/contract_wrappers
/packages/metacoin/artifacts
/packages/sra-spec/public/
/packages/dev-tools-pages/ts/**/data.json
package.json
@@ -37,3 +35,6 @@ packages/sol-coverage/test/fixtures/artifacts
.pytest_cache
.mypy_cache
.tox
packages/abi-gen/test-cli/fixtures/artifacts/AbiGenDummy.json
packages/abi-gen/test-cli/fixtures/artifacts/LibDummy.json
packages/abi-gen/test-cli/fixtures/artifacts/TestLibDummy.json

View File

@@ -20,7 +20,6 @@ packages/contract-artifacts/ @albrow
packages/dev-utils/ @LogvinovLeon @fabioberger
packages/devnet/ @albrow
packages/ethereum-types/ @LogvinovLeon
packages/metacoin/ @LogvinovLeon
packages/monorepo-scripts/ @fabioberger
packages/order-utils/ @fabioberger @LogvinovLeon
packages/python-contract-wrappers/ @feuGeneA

View File

@@ -28,6 +28,7 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [`0x-contract-addresses`](/python-packages/contract_addresses) | [![PyPI](https://img.shields.io/pypi/v/0x-contract-addresses.svg)](https://pypi.org/project/0x-contract-addresses/) | A tiny utility library for getting known deployed contract addresses for a particular network |
| [`0x-contract-artifacts`](/python-packages/contract_artifacts) | [![PyPI](https://img.shields.io/pypi/v/0x-contract-artifacts.svg)](https://pypi.org/project/0x-contract-artifacts/) | 0x smart contract compilation artifacts |
| [`0x-contract-wrappers`](/python-packages/contract_wrappers) | [![PyPI](https://img.shields.io/pypi/v/0x-contract-wrappers.svg)](https://pypi.org/project/0x-contract-wrappers/) | 0x smart contract wrappers |
| [`0x-json-schemas`](/python-packages/json_schemas) | [![PyPI](https://img.shields.io/pypi/v/0x-json-schemas.svg)](https://pypi.org/project/0x-json-schemas/) | 0x-related JSON schemas |
| [`0x-order-utils`](/python-packages/order_utils) | [![PyPI](https://img.shields.io/pypi/v/0x-order-utils.svg)](https://pypi.org/project/0x-order-utils/) | A set of utilities for generating, parsing, signing and validating 0x orders |
| [`0x-sra-client`](/python-packages/sra_client) | [![PyPI](https://img.shields.io/pypi/v/0x-sra-client.svg)](https://pypi.org/project/0x-sra-client/) | A Python client for interacting with servers conforming to the Standard Relayer API specification |
@@ -62,14 +63,14 @@ These packages are all under development. See [/contracts/README.md](/contracts/
| [`@0x/contract-addresses`](/packages/contract-addresses) | [![npm](https://img.shields.io/npm/v/@0x/contract-addresses.svg)](https://www.npmjs.com/package/@0x/contract-addresses) | A tiny utility library for getting known deployed contract addresses for a particular network. |
| [`@0x/contract-wrappers`](/packages/contract-wrappers) | [![npm](https://img.shields.io/npm/v/@0x/contract-wrappers.svg)](https://www.npmjs.com/package/@0x/contract-wrappers) | JS/TS wrappers for interacting with the 0x smart contracts |
| [`@0x/order-utils`](/packages/order-utils) | [![npm](https://img.shields.io/npm/v/@0x/order-utils.svg)](https://www.npmjs.com/package/@0x/order-utils) | A set of utilities for generating, parsing, signing and validating 0x orders |
| [`@0x/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0x/json-schemas.svg)](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas |
| [`@0x/order-watcher`](/packages/order-watcher) | [![npm](https://img.shields.io/npm/v/@0x/order-watcher.svg)](https://www.npmjs.com/package/@0x/order-watcher) | An order watcher daemon that watches for order validity |
| [`@0x/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0x/json-schemas.svg)](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas | |
| [`@0x/migrations`](/packages/migrations) | [![npm](https://img.shields.io/npm/v/@0x/migrations.svg)](https://www.npmjs.com/package/@0x/migrations) | Migration tool for deploying 0x smart contracts on private testnets |
| [`@0x/contract-artifacts`](/packages/contract-artifacts) | [![npm](https://img.shields.io/npm/v/@0x/contract-artifacts.svg)](https://www.npmjs.com/package/@0x/contract-artifacts) | 0x smart contract compilation artifacts |
| [`@0x/abi-gen-wrappers`](/packages/abi-gen-wrappers) | [![npm](https://img.shields.io/npm/v/@0x/abi-gen-wrappers.svg)](https://www.npmjs.com/package/@0x/abi-gen-wrappers) | Low-level 0x smart contract wrappers generated using `@0x/abi-gen` |
| [`@0x/sra-spec`](/packages/sra-spec) | [![npm](https://img.shields.io/npm/v/@0x/sra-spec.svg)](https://www.npmjs.com/package/@0x/sra-spec) | OpenAPI specification for the Standard Relayer API |
| [`@0x/connect`](/packages/connect) | [![npm](https://img.shields.io/npm/v/@0x/connect.svg)](https://www.npmjs.com/package/@0x/connect) | An HTTP/WS client for interacting with the Standard Relayer API |
| [`@0x/asset-buyer`](/packages/asset-buyer) | [![npm](https://img.shields.io/npm/v/@0x/asset-buyer.svg)](https://www.npmjs.com/package/@0x/asset-buyer) | Convenience package for discovering and buying assets with Ether |
| [`@0x/asset-swapper`](/packages/asset-swapper) | [![npm](https://img.shields.io/npm/v/@0x/asset-swapper.svg)](https://www.npmjs.com/package/@0x/asset-swapper) | Convenience package for discovering and performing swaps for any ERC20 Assets |
#### Ethereum tooling
@@ -86,19 +87,17 @@ These packages are all under development. See [/contracts/README.md](/contracts/
#### Utilities
| Package | Version | Description |
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [`@0x/abi-gen`](/packages/abi-gen) | [![npm](https://img.shields.io/npm/v/@0x/abi-gen.svg)](https://www.npmjs.com/package/@0x/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
| [`@0x/tslint-config`](/packages/tslint-config) | [![npm](https://img.shields.io/npm/v/@0x/tslint-config.svg)](https://www.npmjs.com/package/@0x/tslint-config) | Custom TSLint rules used by the 0x core team |
| [`@0x/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0x/types.svg)](https://www.npmjs.com/package/@0x/types) | Shared type declarations |
| [`@0x/typescript-typings`](/packages/typescript-typings) | [![npm](https://img.shields.io/npm/v/@0x/typescript-typings.svg)](https://www.npmjs.com/package/@0x/typescript-typings) | Repository of types for external packages |
| [`@0x/utils`](/packages/utils) | [![npm](https://img.shields.io/npm/v/@0x/utils.svg)](https://www.npmjs.com/package/@0x/utils) | Shared utilities |
| [`@0x/react-docs`](/packages/react-docs) | [![npm](https://img.shields.io/npm/v/@0x/react-docs.svg)](https://www.npmjs.com/package/@0x/react-docs) | React documentation component for rendering TypeDoc & sol-doc generated JSON |
| [`@0x/react-shared`](/packages/react-shared) | [![npm](https://img.shields.io/npm/v/@0x/react-shared.svg)](https://www.npmjs.com/package/@0x/react-shared) | 0x shared react components |
| [`@0x/assert`](/packages/assert) | [![npm](https://img.shields.io/npm/v/@0x/assert.svg)](https://www.npmjs.com/package/@0x/assert) | Type and schema assertions used by our packages |
| [`@0x/base-contract`](/packages/base-contract) | [![npm](https://img.shields.io/npm/v/@0x/base-contract.svg)](https://www.npmjs.com/package/@0x/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
| [`@0x/dev-utils`](/packages/dev-utils) | [![npm](https://img.shields.io/npm/v/@0x/dev-utils.svg)](https://www.npmjs.com/package/@0x/dev-utils) | Dev utils to be shared across 0x packages |
| [`@0x/fill-scenarios`](/packages/fill-scenarios) | [![npm](https://img.shields.io/npm/v/@0x/fill-scenarios.svg)](https://www.npmjs.com/package/@0x/fill-scenarios) | 0x order fill scenario generator |
| Package | Version | Description |
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [`@0x/abi-gen`](/packages/abi-gen) | [![npm](https://img.shields.io/npm/v/@0x/abi-gen.svg)](https://www.npmjs.com/package/@0x/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
| [`@0x/tslint-config`](/packages/tslint-config) | [![npm](https://img.shields.io/npm/v/@0x/tslint-config.svg)](https://www.npmjs.com/package/@0x/tslint-config) | Custom TSLint rules used by the 0x core team |
| [`@0x/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0x/types.svg)](https://www.npmjs.com/package/@0x/types) | Shared type declarations |
| [`@0x/typescript-typings`](/packages/typescript-typings) | [![npm](https://img.shields.io/npm/v/@0x/typescript-typings.svg)](https://www.npmjs.com/package/@0x/typescript-typings) | Repository of types for external packages |
| [`@0x/utils`](/packages/utils) | [![npm](https://img.shields.io/npm/v/@0x/utils.svg)](https://www.npmjs.com/package/@0x/utils) | Shared utilities |
| [`@0x/assert`](/packages/assert) | [![npm](https://img.shields.io/npm/v/@0x/assert.svg)](https://www.npmjs.com/package/@0x/assert) | Type and schema assertions used by our packages |
| [`@0x/base-contract`](/packages/base-contract) | [![npm](https://img.shields.io/npm/v/@0x/base-contract.svg)](https://www.npmjs.com/package/@0x/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
| [`@0x/dev-utils`](/packages/dev-utils) | [![npm](https://img.shields.io/npm/v/@0x/dev-utils.svg)](https://www.npmjs.com/package/@0x/dev-utils) | Dev utils to be shared across 0x packages |
| [`@0x/fill-scenarios`](/packages/fill-scenarios) | [![npm](https://img.shields.io/npm/v/@0x/fill-scenarios.svg)](https://www.npmjs.com/package/@0x/fill-scenarios) | 0x order fill scenario generator |
#### Private Packages
@@ -110,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.
@@ -139,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:

View File

@@ -1,4 +1,59 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "2.2.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "2.2.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "2.2.0",
"changes": [

View File

@@ -5,6 +5,30 @@ 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
## v2.2.2 - _July 15, 2019_
* Dependencies updated
## v2.2.1 - _July 13, 2019_
* Dependencies updated
## v2.2.0 - _July 13, 2019_
* Add `LibAssetProxyIds` contract (#1835)

View File

@@ -18,349 +18,71 @@
pragma solidity ^0.5.9;
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
import "@0x/contracts-utils/contracts/src/SafeMath.sol";
import "@0x/contracts-erc1155/contracts/src/interfaces/IERC1155.sol";
import "./MixinAuthorizable.sol";
import "./interfaces/IAssetProxy.sol";
contract ERC1155Proxy is
MixinAuthorizable
MixinAuthorizable,
SafeMath,
IAssetProxy
{
using LibBytes for bytes;
// Id of this proxy.
bytes4 constant internal PROXY_ID = bytes4(keccak256("ERC1155Assets(address,uint256[],uint256[],bytes)"));
// solhint-disable-next-line payable-fallback
function ()
/// @dev Transfers batch of ERC1155 assets. Either succeeds or throws.
/// @param assetData Byte array encoded with ERC1155 token address, array of ids, array of values, and callback data.
/// @param from Address to transfer assets from.
/// @param to Address to transfer assets to.
/// @param amount Amount that will be multiplied with each element of `assetData.values` to scale the
/// values that will be transferred.
function transferFrom(
bytes calldata assetData,
address from,
address to,
uint256 amount
)
external
onlyAuthorized
{
// Input calldata to this function is encoded as follows:
// -- TABLE #1 --
// | Area | Offset (**) | Length | Contents |
// |----------|-------------|-------------|---------------------------------|
// | Header | 0 | 4 | function selector |
// | Params | | 4 * 32 | function parameters: |
// | | 4 | | 1. offset to assetData (*) |
// | | 36 | | 2. from |
// | | 68 | | 3. to |
// | | 100 | | 4. amount |
// | Data | | | assetData: |
// | | 132 | 32 | assetData Length |
// | | 164 | (see below) | assetData Contents |
//
//
// Asset data is encoded as follows:
// -- TABLE #2 --
// | Area | Offset | Length | Contents |
// |----------|-------------|---------|-------------------------------------|
// | Header | 0 | 4 | assetProxyId |
// | Params | | 4 * 32 | function parameters: |
// | | 4 | | 1. address of ERC1155 contract |
// | | 36 | | 2. offset to ids (*) |
// | | 68 | | 3. offset to values (*) |
// | | 100 | | 4. offset to data (*) |
// | Data | | | ids: |
// | | 132 | 32 | 1. ids Length |
// | | 164 | a | 2. ids Contents |
// | | | | values: |
// | | 164 + a | 32 | 1. values Length |
// | | 196 + a | b | 2. values Contents |
// | | | | data: |
// | | 196 + a + b | 32 | 1. data Length |
// | | 228 + a + b | c | 2. data Contents |
//
//
// Calldata for target ERC155 asset is encoded for safeBatchTransferFrom:
// -- TABLE #3 --
// | Area | Offset (**) | Length | Contents |
// |----------|-------------|---------|-------------------------------------|
// | Header | 0 | 4 | safeBatchTransferFrom selector |
// | Params | | 5 * 32 | function parameters: |
// | | 4 | | 1. from address |
// | | 36 | | 2. to address |
// | | 68 | | 3. offset to ids (*) |
// | | 100 | | 4. offset to values (*) |
// | | 132 | | 5. offset to data (*) |
// | Data | | | ids: |
// | | 164 | 32 | 1. ids Length |
// | | 196 | a | 2. ids Contents |
// | | | | values: |
// | | 196 + a | 32 | 1. values Length |
// | | 228 + a | b | 2. values Contents |
// | | | | data: |
// | | 228 + a + b | 32 | 1. data Length |
// | | 260 + a + b | c | 2. data Contents |
//
//
// (*): offset is computed from start of function parameters, so offset
// by an additional 4 bytes in the calldata.
//
// (**): the `Offset` column is computed assuming no calldata compression;
// offsets in the Data Area are dynamic and should be evaluated in
// real-time.
//
// WARNING: The ABIv2 specification allows additional padding between
// the Params and Data section. This will result in a larger
// offset to assetData.
//
// Note: Table #1 and Table #2 exist in Calldata. We construct Table #3 in memory.
//
//
assembly {
// The first 4 bytes of calldata holds the function selector
let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)
// Decode params from `assetData`
// solhint-disable indent
(
address erc1155TokenAddress,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) = abi.decode(
assetData.sliceDestructive(4, assetData.length),
(address, uint256[], uint256[], bytes)
);
// solhint-enable indent
// `transferFrom` will be called with the following parameters:
// assetData Encoded byte array.
// from Address to transfer asset from.
// to Address to transfer asset to.
// amount Amount of asset to transfer.
// bytes4(keccak256("transferFrom(bytes,address,address,uint256)")) = 0xa85e59e4
if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {
// To lookup a value in a mapping, we load from the storage location keccak256(k, p),
// where k is the key left padded to 32 bytes and p is the storage slot
mstore(0, caller)
mstore(32, authorized_slot)
// Revert if authorized[msg.sender] == false
if iszero(sload(keccak256(0, 64))) {
// Revert with `Error("SENDER_NOT_AUTHORIZED")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)
mstore(96, 0)
revert(0, 100)
}
// Construct Table #3 in memory, starting at memory offset 0.
// The algorithm below maps calldata (Table #1) and assetData (Table #2) to memory (Table #3).
// Once Table #3 ha been constructed in memory, the destination erc1155 contract is called using this
// as its calldata. This process is divided into three steps, below.
////////// STEP 1/3 - Map calldata to memory (Table #1 -> Table #3) //////////
// Store the safeBatchTransferFrom function selector, which is computed using:
// bytes4(keccak256("safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)"))
mstore(0, 0x2eb2c2d600000000000000000000000000000000000000000000000000000000)
// Copy `from` and `to` fields from calldata (Table #1) into memory (Table #3)
calldatacopy(
4, // aligned such that `from` and `to` are at the correct location for Table #3
36, // beginning of `from` field from Table #1
64 // 32 bytes for `from` + 32 bytes for `to` field
)
////////// STEP 2/3 - Map assetData to memory (Table #2 -> Table #3) //////////
// Map relevant fields from assetData (Table #2) into memory (Table #3)
// The Contents column of Table #2 is the same as Table #3,
// beginning from parameter 3 - `offset to ids (*)`
// The `values` from assetData (Table #2) are multiplied by `amount` (Table #1)
// when they are copied into memory.
// Load offset to `assetData`
let assetDataOffset := add(calldataload(4), 4)
// Load length in bytes of `assetData`
let assetDataLength := calldataload(assetDataOffset)
// Assert that the length of asset data:
// 1. Must be at least 132 bytes (Table #2)
// 2. Must be a multiple of 32 (excluding the 4-byte selector)
if or(lt(assetDataLength, 132), mod(sub(assetDataLength, 4), 32)) {
// Revert with `Error("INVALID_ASSET_DATA_LENGTH")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x00000019494e56414c49445f41535345545f444154415f4c454e475448000000)
mstore(96, 0)
revert(0, 100)
}
// End of asset data in calldata
// +32 for length field
let assetDataEnd := add(assetDataOffset, add(assetDataLength, 32))
if gt(assetDataEnd, calldatasize()) {
// Revert with `Error("INVALID_ASSET_DATA_END")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x00000016494e56414c49445f41535345545f444154415f454e44000000000000)
mstore(96, 0)
revert(0, 100)
}
// Load offset to parameters section in asset data
let paramsInAssetDataOffset := add(assetDataOffset, 36)
// Offset of end of Data Area in memory.
// This value will grow as we construct Table #3.
let dataAreaEndOffset := 164
// Load amount by which to scale values
let amount := calldataload(100)
// Store pointer to `ids` (Table #3)
// Subtract 4 for `safeBatchTransferFrom` selector
mstore(68, sub(dataAreaEndOffset, 4))
// Ensure length of `ids` does not overflow
let idsOffset := add(paramsInAssetDataOffset, calldataload(add(assetDataOffset, 68)))
let idsLength := calldataload(idsOffset)
let idsLengthInBytes := mul(idsLength, 32)
if sub(div(idsLengthInBytes, 32), idsLength) {
// Revert with `Error("UINT256_OVERFLOW")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x0000001055494e543235365f4f564552464c4f57000000000000000000000000)
mstore(96, 0)
revert(0, 100)
}
// Ensure `ids` does not resolve to outside of `assetData`
let idsBegin := add(idsOffset, 32)
let idsEnd := add(idsBegin, idsLengthInBytes)
if gt(idsEnd, assetDataEnd) {
// Revert with `Error("INVALID_IDS_OFFSET")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x00000012494e56414c49445f4944535f4f464653455400000000000000000000)
mstore(96, 0)
revert(0, 100)
}
// Copy `ids` from `assetData` (Table #2) to memory (Table #3)
calldatacopy(
dataAreaEndOffset,
idsOffset,
add(idsLengthInBytes, 32)
)
dataAreaEndOffset := add(dataAreaEndOffset, add(idsLengthInBytes, 32))
// Store pointer to `values` (Table #3)
// Subtract 4 for `safeBatchTrasferFrom` selector
mstore(100, sub(dataAreaEndOffset, 4))
// Ensure length of `values` does not overflow
let valuesOffset := add(paramsInAssetDataOffset, calldataload(add(assetDataOffset, 100)))
let valuesLength := calldataload(valuesOffset)
let valuesLengthInBytes := mul(valuesLength, 32)
if sub(div(valuesLengthInBytes, 32), valuesLength) {
// Revert with `Error("UINT256_OVERFLOW")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x0000001055494e543235365f4f564552464c4f57000000000000000000000000)
mstore(96, 0)
revert(0, 100)
}
// Ensure `values` does not resolve to outside of `assetData`
let valuesBegin := add(valuesOffset, 32)
let valuesEnd := add(valuesBegin, valuesLengthInBytes)
if gt(valuesEnd, assetDataEnd) {
// Revert with `Error("INVALID_VALUES_OFFSET")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x00000015494e56414c49445f56414c5545535f4f464653455400000000000000)
mstore(96, 0)
revert(0, 100)
}
// Store length of `values`
mstore(dataAreaEndOffset, valuesLength)
dataAreaEndOffset := add(dataAreaEndOffset, 32)
// Scale and store elements of `values`
for { let currentValueOffset := valuesBegin }
lt(currentValueOffset, valuesEnd)
{ currentValueOffset := add(currentValueOffset, 32) }
{
// Load value and generate scaled value
let currentValue := calldataload(currentValueOffset)
let currentValueScaled := mul(currentValue, amount)
// Revert if `amount` != 0 and multiplication resulted in an overflow
if iszero(or(
iszero(amount),
eq(div(currentValueScaled, amount), currentValue)
)) {
// Revert with `Error("UINT256_OVERFLOW")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x0000001055494e543235365f4f564552464c4f57000000000000000000000000)
mstore(96, 0)
revert(0, 100)
}
// There was no overflow, store the scaled token value
mstore(dataAreaEndOffset, currentValueScaled)
dataAreaEndOffset := add(dataAreaEndOffset, 32)
}
// Store pointer to `data` (Table #3)
// Subtract 4 for `safeBatchTrasferFrom` selector
mstore(132, sub(dataAreaEndOffset, 4))
// Ensure `data` does not resolve to outside of `assetData`
let dataOffset := add(paramsInAssetDataOffset, calldataload(add(assetDataOffset, 132)))
let dataLengthInBytes := calldataload(dataOffset)
let dataBegin := add(dataOffset, 32)
let dataEnd := add(dataBegin, dataLengthInBytes)
if gt(dataEnd, assetDataEnd) {
// Revert with `Error("INVALID_DATA_OFFSET")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x00000013494e56414c49445f444154415f4f4646534554000000000000000000)
mstore(96, 0)
revert(0, 100)
}
// Copy `data` from `assetData` (Table #2) to memory (Table #3)
calldatacopy(
dataAreaEndOffset,
dataOffset,
add(dataLengthInBytes, 32)
)
// Update the end of data offset to be word-aligned
let dataLengthInWords := div(add(dataLengthInBytes, 31), 32)
let dataLengthInBytesWordAligned := mul(dataLengthInWords, 32)
dataAreaEndOffset := add(dataAreaEndOffset, add(dataLengthInBytesWordAligned, 32))
////////// STEP 3/3 - Execute Transfer //////////
// Load the address of the destination erc1155 contract from asset data (Table #2)
// +32 bytes for assetData Length
// +4 bytes for assetProxyId
let assetAddress := and(
calldataload(add(assetDataOffset, 36)),
0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffff
)
// Call into the destination erc1155 contract using as calldata Table #3 (constructed in-memory above)
let success := call(
gas, // forward all gas
assetAddress, // call address of erc1155 asset
0, // don't send any ETH
0, // pointer to start of input
dataAreaEndOffset, // length of input is the end of the Data Area (Table #3)
0, // write output over memory that won't be reused
0 // don't copy output to memory
)
// Revert with reason given by AssetProxy if `transferFrom` call failed
if iszero(success) {
returndatacopy(
0, // copy to memory at 0
0, // copy from return data at 0
returndatasize() // copy all return data
)
revert(0, returndatasize())
}
// Return if call was successful
return(0, 0)
}
// Revert if undefined function is called
revert(0, 0)
// Scale values up by `amount`
uint256 length = values.length;
uint256[] memory scaledValues = new uint256[](length);
for (uint256 i = 0; i != length; i++) {
// We write the scaled values to an unused location in memory in order
// to avoid copying over `ids` or `data`. This is possible if they are
// identical to `values` and the offsets for each are pointing to the
// same location in the ABI encoded calldata.
scaledValues[i] = safeMul(values[i], amount);
}
// Execute `safeBatchTransferFrom` call
// Either succeeds or throws
IERC1155(erc1155TokenAddress).safeBatchTransferFrom(
from,
to,
ids,
scaledValues,
data
);
}
/// @dev Gets the proxy id associated with the proxy address.

View File

@@ -90,7 +90,10 @@ contract MultiAssetProxy is
// offset to assetData.
// Load offset to `assetData`
let assetDataOffset := calldataload(4)
let assetDataOffset := add(calldataload(4), 4)
// Load length in bytes of `assetData`
let assetDataLength := calldataload(assetDataOffset)
// Asset data itself is encoded as follows:
//
@@ -108,41 +111,62 @@ contract MultiAssetProxy is
// | | 132 + a | b | nestedAssetData Contents (offsets) |
// | | 132 + a + b | | nestedAssetData[0, ..., len] |
// Assert that the length of asset data:
// 1. Must be at least 68 bytes (see table above)
// 2. Must be a multiple of 32 (excluding the 4-byte selector)
if or(lt(assetDataLength, 68), mod(sub(assetDataLength, 4), 32)) {
// Revert with `Error("INVALID_ASSET_DATA_LENGTH")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x00000019494e56414c49445f41535345545f444154415f4c454e475448000000)
mstore(96, 0)
revert(0, 100)
}
// End of asset data in calldata
// assetDataOffset
// + 32 (assetData len)
let assetDataEnd := add(assetDataOffset, add(assetDataLength, 32))
if gt(assetDataEnd, calldatasize()) {
// Revert with `Error("INVALID_ASSET_DATA_END")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x00000016494e56414c49445f41535345545f444154415f454e44000000000000)
mstore(96, 0)
revert(0, 100)
}
// In order to find the offset to `amounts`, we must add:
// 4 (function selector)
// + assetDataOffset
// assetDataOffset
// + 32 (assetData len)
// + 4 (assetProxyId)
let amountsOffset := calldataload(add(assetDataOffset, 40))
let amountsOffset := calldataload(add(assetDataOffset, 36))
// In order to find the offset to `nestedAssetData`, we must add:
// 4 (function selector)
// + assetDataOffset
// assetDataOffset
// + 32 (assetData len)
// + 4 (assetProxyId)
// + 32 (amounts offset)
let nestedAssetDataOffset := calldataload(add(assetDataOffset, 72))
let nestedAssetDataOffset := calldataload(add(assetDataOffset, 68))
// In order to find the start of the `amounts` contents, we must add:
// 4 (function selector)
// + assetDataOffset
// assetDataOffset
// + 32 (assetData len)
// + 4 (assetProxyId)
// + amountsOffset
// + 32 (amounts len)
let amountsContentsStart := add(assetDataOffset, add(amountsOffset, 72))
let amountsContentsStart := add(assetDataOffset, add(amountsOffset, 68))
// Load number of elements in `amounts`
let amountsLen := calldataload(sub(amountsContentsStart, 32))
// In order to find the start of the `nestedAssetData` contents, we must add:
// 4 (function selector)
// + assetDataOffset
// assetDataOffset
// + 32 (assetData len)
// + 4 (assetProxyId)
// + nestedAssetDataOffset
// + 32 (nestedAssetData len)
let nestedAssetDataContentsStart := add(assetDataOffset, add(nestedAssetDataOffset, 72))
let nestedAssetDataContentsStart := add(assetDataOffset, add(nestedAssetDataOffset, 68))
// Load number of elements in `nestedAssetData`
let nestedAssetDataLen := calldataload(sub(nestedAssetDataContentsStart, 32))
@@ -204,15 +228,20 @@ contract MultiAssetProxy is
let nestedAssetDataElementOffset := calldataload(add(nestedAssetDataContentsStart, i))
// In order to find the start of the `nestedAssetData[i]` contents, we must add:
// 4 (function selector)
// + assetDataOffset
// assetDataOffset
// + 32 (assetData len)
// + 4 (assetProxyId)
// + nestedAssetDataOffset
// + 32 (nestedAssetData len)
// + nestedAssetDataElementOffset
// + 32 (nestedAssetDataElement len)
let nestedAssetDataElementContentsStart := add(assetDataOffset, add(nestedAssetDataOffset, add(nestedAssetDataElementOffset, 104)))
let nestedAssetDataElementContentsStart := add(
assetDataOffset,
add(
nestedAssetDataOffset,
add(nestedAssetDataElementOffset, 100)
)
)
// Load length of `nestedAssetData[i]`
let nestedAssetDataElementLenStart := sub(nestedAssetDataElementContentsStart, 32)

View File

@@ -18,181 +18,57 @@
pragma solidity ^0.5.9;
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
// solhint-disable no-unused-vars
contract StaticCallProxy {
using LibBytes for bytes;
// Id of this proxy.
bytes4 constant internal PROXY_ID = bytes4(keccak256("StaticCall(address,bytes,bytes32)"));
// solhint-disable-next-line payable-fallback
function ()
/// @dev Makes a staticcall to a target address and verifies that the data returned matches the expected return data.
/// @param assetData Byte array encoded with staticCallTarget, staticCallData, and expectedCallResultHash
/// @param from This value is ignored.
/// @param to This value is ignored.
/// @param amount This value is ignored.
function transferFrom(
bytes calldata assetData,
address from,
address to,
uint256 amount
)
external
view
{
assembly {
// The first 4 bytes of calldata holds the function selector
let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)
// Decode params from `assetData`
(
address staticCallTarget,
bytes memory staticCallData,
bytes32 expectedReturnDataHash
) = abi.decode(
assetData.sliceDestructive(4, assetData.length),
(address, bytes, bytes32)
);
// `transferFrom` will be called with the following parameters:
// assetData Encoded byte array.
// from Address to transfer asset from.
// to Address to transfer asset to.
// amount Amount of asset to transfer.
// bytes4(keccak256("transferFrom(bytes,address,address,uint256)")) = 0xa85e59e4
if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {
// Execute staticcall
(bool success, bytes memory returnData) = staticCallTarget.staticcall(staticCallData);
// `transferFrom`.
// The function is marked `external`, so no abi decoding is done for
// us. Instead, we expect the `calldata` memory to contain the
// following:
//
// | Area | Offset | Length | Contents |
// |----------|--------|---------|-------------------------------------|
// | Header | 0 | 4 | function selector |
// | Params | | 4 * 32 | function parameters: |
// | | 4 | | 1. offset to assetData (*) |
// | | 36 | | 2. from |
// | | 68 | | 3. to |
// | | 100 | | 4. amount |
// | Data | | | assetData: |
// | | 132 | 32 | assetData Length |
// | | 164 | ** | assetData Contents |
//
// (*): offset is computed from start of function parameters, so offset
// by an additional 4 bytes in the calldata.
//
// (**): see table below to compute length of assetData Contents
// (***): Note that the `from`, `to`, and `amount` params in calldata are ignored in this function.
//
// WARNING: The ABIv2 specification allows additional padding between
// the Params and Data section. This will result in a larger
// offset to assetData.
// Load offset to `assetData`
let assetDataOffset := add(calldataload(4), 4)
// Validate length of `assetData`
let assetDataLen := calldataload(assetDataOffset)
if or(lt(assetDataLen, 100), mod(sub(assetDataLen, 4), 32)) {
// Revert with `Error("INVALID_ASSET_DATA_LENGTH")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x00000019494e56414c49445f41535345545f444154415f4c454e475448000000)
mstore(96, 0)
revert(0, 100)
}
// Ensure that `assetData` ends inside of calldata
let assetDataEnd := add(assetDataOffset, add(assetDataLen, 32))
if gt(assetDataEnd, calldatasize()) {
// Revert with `Error("INVALID_ASSET_DATA_END")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x00000016494e56414c49445f41535345545f444154415f454e44000000000000)
mstore(96, 0)
revert(0, 100)
}
// Asset data is encoded as follows:
// | Area | Offset | Length | Contents |
// |----------|-------------|---------|--------------------------------------|
// | Header | 0 | 4 | assetProxyId |
// | Params | | 4 * 32 | function parameters: |
// | | 4 | | 1. address of callTarget |
// | | 36 | | 2. offset to staticCallData (*) |
// | | 68 | | 3. expected 32 byte hash of output |
// | Data | | | staticCallData: |
// | | 100 | 32 | 1. staticCallData Length |
// | | 132 | a | 2. staticCallData Contents |
// In order to find the offset to `staticCallData`, we must add:
// assetDataOffset
// + 32 (assetData len)
// + 4 (proxyId)
// + 32 (callTarget)
let paramsInAssetDataOffset := add(assetDataOffset, 36)
let staticCallDataOffset := add(paramsInAssetDataOffset, calldataload(add(assetDataOffset, 68)))
// Load length of `staticCallData`
let staticCallDataLen := calldataload(staticCallDataOffset)
// Ensure `staticCallData` does not begin to outside of `assetData`
let staticCallDataBegin := add(staticCallDataOffset, 32)
let staticCallDataEnd := add(staticCallDataBegin, staticCallDataLen)
if gt(staticCallDataEnd, assetDataEnd) {
// Revert with `Error("INVALID_STATIC_CALL_DATA_OFFSET")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x0000001f494e56414c49445f5354415449435f43414c4c5f444154415f4f4646)
mstore(96, 0x5345540000000000000000000000000000000000000000000000000000000000)
revert(0, 100)
}
// Copy `staticCallData` into memory
calldatacopy(
0, // memory can be safely overwritten from beginning
staticCallDataBegin, // start of `staticCallData`
staticCallDataLen // copy the entire `staticCallData`
)
// In order to find the offset to `callTarget`, we must add:
// assetDataOffset
// + 32 (assetData len)
// + 4 (proxyId)
let callTarget := and(
calldataload(add(assetDataOffset, 36)),
0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffff
)
// Perform `callTarget.staticcall(staticCallData)`
let success := staticcall(
gas, // forward all gas
callTarget, // call address `callTarget`
0, // pointer to start of input
staticCallDataLen, // length of input
0, // start of memory can be safely overwritten
0 // don't copy output to memory
)
// Copy entire output to start of memory
let outputLen := returndatasize()
returndatacopy(
0, // copy to memory at 0
0, // copy from return data at 0
outputLen // copy all return data
)
// Revert with reason given by `callTarget` if staticcall is unsuccessful
if iszero(success) {
revert(0, outputLen)
}
// Calculate hash of output
let callResultHash := keccak256(0, outputLen)
// In order to find the offset to `expectedCallResultHash`, we must add:
// assetDataOffset
// + 32 (assetData len)
// + 4 (proxyId)
// + 32 (callTarget)
// + 32 (staticCallDataOffset)
let expectedResultHash := calldataload(add(assetDataOffset, 100))
if sub(callResultHash, expectedResultHash) {
// Revert with `Error("UNEXPECTED_STATIC_CALL_RESULT")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x0000001d554e45585045435445445f5354415449435f43414c4c5f524553554c)
mstore(96, 0x5400000000000000000000000000000000000000000000000000000000000000)
revert(0, 100)
}
// Return if output matched expected output
return(0, 0)
// Revert with returned data if staticcall is unsuccessful
if (!success) {
assembly {
revert(add(returnData, 32), mload(returnData))
}
// Revert if undefined function is called
revert(0, 0)
}
// Revert if hash of return data is not as expected
bytes32 returnDataHash = keccak256(returnData);
require(
expectedReturnDataHash == returnDataHash,
"UNEXPECTED_STATIC_CALL_RESULT"
);
}
/// @dev Gets the proxy id associated with the proxy address.
@@ -204,4 +80,4 @@ contract StaticCallProxy {
{
return PROXY_ID;
}
}
}

View File

@@ -21,9 +21,8 @@ pragma solidity ^0.5.5;
import "./IAuthorizable.sol";
contract IAssetProxy is
IAuthorizable
{
contract IAssetProxy {
/// @dev Transfers assets. Either succeeds or throws.
/// @param assetData Byte array encoded for the respective asset proxy.
/// @param from Address to transfer asset from.

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-asset-proxy",
"version": "2.2.0",
"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": "^2.1.0",
"@0x/contracts-gen": "^1.0.10",
"@0x/contracts-test-utils": "^3.1.8",
"@0x/dev-utils": "^2.2.4",
"@0x/sol-compiler": "^3.1.9",
"@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.1",
"@0x/contracts-erc1155": "^1.1.7",
"@0x/contracts-erc20": "^2.2.6",
"@0x/contracts-erc721": "^2.1.7",
"@0x/contracts-utils": "^3.1.7",
"@0x/order-utils": "^8.2.0",
"@0x/types": "^2.4.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"ethereum-types": "^2.1.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.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.11"
},

View File

@@ -37,6 +37,7 @@ describe('Authorizable', () => {
artifacts.MixinAuthorizable,
provider,
txDefaults,
artifacts,
);
});
beforeEach(async () => {

View File

@@ -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();
@@ -1077,7 +1078,7 @@ describe('ERC1155Proxy', () => {
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
//
// We want to chan ge the offset to token ids to point outside the calldata.
// We want to change the offset to token ids to point outside the calldata.
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000080';
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000180';
const assetDataWithBadTokenIdsOffset = assetData.replace(
@@ -1085,7 +1086,7 @@ describe('ERC1155Proxy', () => {
badEncodedOffsetToTokenIds,
);
// execute transfer
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
erc1155ProxyWrapper.transferFromAsync(
spender,
receiverContract,
@@ -1097,7 +1098,6 @@ describe('ERC1155Proxy', () => {
authorized,
assetDataWithBadTokenIdsOffset,
),
RevertReason.InvalidIdsOffset,
);
});
it('should revert if an element of token ids lies to outside the bounds of calldata', async () => {
@@ -1125,7 +1125,7 @@ describe('ERC1155Proxy', () => {
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
//
// We want to chan ge the offset to token ids to the end of calldata.
// We want to change the offset to token ids to the end of calldata.
// Then we'll add an invalid length: we encode length of 2 but only add 1 element.
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000080';
const newEcodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
@@ -1137,7 +1137,7 @@ describe('ERC1155Proxy', () => {
const encodedTokenIdValues = '0000000000000000000000000000000000000000000000000000000000000001';
const assetDataWithBadTokenIds = `${assetDataWithNewTokenIdsOffset}${encodedTokenIdsLength}${encodedTokenIdValues}`;
// execute transfer
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
erc1155ProxyWrapper.transferFromAsync(
spender,
receiverContract,
@@ -1149,7 +1149,6 @@ describe('ERC1155Proxy', () => {
authorized,
assetDataWithBadTokenIds,
),
RevertReason.InvalidIdsOffset,
);
});
it('should revert token ids length overflows', async () => {
@@ -1177,7 +1176,7 @@ describe('ERC1155Proxy', () => {
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
//
// We want to chan ge the offset to token ids to point to the end of calldata
// We want to change the offset to token ids to point to the end of calldata
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000080';
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
const assetDataWithBadTokenIdsOffset = assetData.replace(
@@ -1189,7 +1188,7 @@ describe('ERC1155Proxy', () => {
const buffer = '0'.repeat(64 * 10);
const assetDataWithOverflow = `${assetDataWithBadTokenIdsOffset}${encodedIdsLengthOverflow}${buffer}`;
// execute transfer
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
erc1155ProxyWrapper.transferFromAsync(
spender,
receiverContract,
@@ -1201,7 +1200,6 @@ describe('ERC1155Proxy', () => {
authorized,
assetDataWithOverflow,
),
RevertReason.Uint256Overflow,
);
});
it('should revert token values length overflows', async () => {
@@ -1229,7 +1227,7 @@ describe('ERC1155Proxy', () => {
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
//
// We want to chan ge the offset to token values to point to the end of calldata
// We want to change the offset to token values to point to the end of calldata
const encodedOffsetToTokenIds = '00000000000000000000000000000000000000000000000000000000000000c0';
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
const assetDataWithBadTokenIdsOffset = assetData.replace(
@@ -1241,7 +1239,7 @@ describe('ERC1155Proxy', () => {
const buffer = '0'.repeat(64 * 10);
const assetDataWithOverflow = `${assetDataWithBadTokenIdsOffset}${encodedIdsLengthOverflow}${buffer}`;
// execute transfer
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
erc1155ProxyWrapper.transferFromAsync(
spender,
receiverContract,
@@ -1253,7 +1251,6 @@ describe('ERC1155Proxy', () => {
authorized,
assetDataWithOverflow,
),
RevertReason.Uint256Overflow,
);
});
it('should revert token data length overflows', async () => {
@@ -1281,7 +1278,7 @@ describe('ERC1155Proxy', () => {
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
//
// We want to chan ge the offset to token ids to point to the end of calldata,
// We want to change the offset to token ids to point to the end of calldata,
// which we'll extend with a bad length.
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000100';
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
@@ -1294,7 +1291,7 @@ describe('ERC1155Proxy', () => {
const buffer = '0'.repeat(64 * 10);
const assetDataWithOverflow = `${assetDataWithBadTokenIdsOffset}${encodedIdsLengthOverflow}${buffer}`;
// execute transfer
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
erc1155ProxyWrapper.transferFromAsync(
spender,
receiverContract,
@@ -1306,7 +1303,6 @@ describe('ERC1155Proxy', () => {
authorized,
assetDataWithOverflow,
),
RevertReason.InvalidDataOffset,
);
});
it('should revert if token values resolves to outside the bounds of calldata', async () => {
@@ -1334,7 +1330,7 @@ describe('ERC1155Proxy', () => {
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
//
// We want to chan ge the offset to token values to point outside the calldata.
// We want to change the offset to token values to point outside the calldata.
const encodedOffsetToTokenValues = '00000000000000000000000000000000000000000000000000000000000000c0';
const badEncodedOffsetToTokenValues = '00000000000000000000000000000000000000000000000000000000000001c0';
const assetDataWithBadTokenIdsOffset = assetData.replace(
@@ -1342,7 +1338,7 @@ describe('ERC1155Proxy', () => {
badEncodedOffsetToTokenValues,
);
// execute transfer
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
erc1155ProxyWrapper.transferFromAsync(
spender,
receiverContract,
@@ -1354,7 +1350,6 @@ describe('ERC1155Proxy', () => {
authorized,
assetDataWithBadTokenIdsOffset,
),
RevertReason.InvalidValuesOffset,
);
});
it('should revert if an element of token values lies to outside the bounds of calldata', async () => {
@@ -1382,7 +1377,7 @@ describe('ERC1155Proxy', () => {
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
//
// We want to chan ge the offset to token values to the end of calldata.
// We want to change the offset to token values to the end of calldata.
// Then we'll add an invalid length: we encode length of 2 but only add 1 element.
const encodedOffsetToTokenValues = '00000000000000000000000000000000000000000000000000000000000000c0';
const newEcodedOffsetToTokenValues = '0000000000000000000000000000000000000000000000000000000000000140';
@@ -1394,7 +1389,7 @@ describe('ERC1155Proxy', () => {
const encodedTokenValuesElements = '0000000000000000000000000000000000000000000000000000000000000001';
const assetDataWithBadTokenIds = `${assetDataWithNewTokenValuesOffset}${encodedTokenValuesLength}${encodedTokenValuesElements}`;
// execute transfer
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
erc1155ProxyWrapper.transferFromAsync(
spender,
receiverContract,
@@ -1406,7 +1401,6 @@ describe('ERC1155Proxy', () => {
authorized,
assetDataWithBadTokenIds,
),
RevertReason.InvalidValuesOffset,
);
});
it('should revert if token data resolves to outside the bounds of calldata', async () => {
@@ -1434,7 +1428,7 @@ describe('ERC1155Proxy', () => {
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
//
// We want to chan ge the offset to token data to point outside the calldata.
// We want to change the offset to token data to point outside the calldata.
const encodedOffsetToTokenData = '0000000000000000000000000000000000000000000000000000000000000100';
const badEncodedOffsetToTokenData = '00000000000000000000000000000000000000000000000000000000000001c0';
const assetDataWithBadTokenDataOffset = assetData.replace(
@@ -1442,7 +1436,7 @@ describe('ERC1155Proxy', () => {
badEncodedOffsetToTokenData,
);
// execute transfer
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
erc1155ProxyWrapper.transferFromAsync(
spender,
receiverContract,
@@ -1454,7 +1448,6 @@ describe('ERC1155Proxy', () => {
authorized,
assetDataWithBadTokenDataOffset,
),
RevertReason.InvalidDataOffset,
);
});
it('should revert if an element of token data lies to outside the bounds of calldata', async () => {
@@ -1482,7 +1475,7 @@ describe('ERC1155Proxy', () => {
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
//
// We want to chan ge the offset to token data to the end of calldata.
// We want to change the offset to token data to the end of calldata.
// Then we'll add an invalid length: we encode length of 33 but only add 32 elements.
const encodedOffsetToTokenData = '0000000000000000000000000000000000000000000000000000000000000100';
const newEcodedOffsetToTokenData = '0000000000000000000000000000000000000000000000000000000000000140';
@@ -1494,7 +1487,7 @@ describe('ERC1155Proxy', () => {
const encodedTokenDataElements = '0000000000000000000000000000000000000000000000000000000000000001';
const assetDataWithBadTokenData = `${assetDataWithNewTokenDataOffset}${encodedTokenDataLength}${encodedTokenDataElements}`;
// execute transfer
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
erc1155ProxyWrapper.transferFromAsync(
spender,
receiverContract,
@@ -1506,7 +1499,6 @@ describe('ERC1155Proxy', () => {
authorized,
assetDataWithBadTokenData,
),
RevertReason.InvalidDataOffset,
);
});
it('should revert if asset data lies outside the bounds of calldata', async () => {
@@ -1536,9 +1528,8 @@ describe('ERC1155Proxy', () => {
const invalidOffsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000180';
const badTxData = txData.replace(offsetToAssetData, invalidOffsetToAssetData);
// execute transfer
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
erc1155ProxyWrapper.transferFromRawAsync(badTxData, authorized),
RevertReason.InvalidAssetDataLength,
);
});
it('should revert if asset data lies outside the bounds of calldata', async () => {
@@ -1570,39 +1561,8 @@ describe('ERC1155Proxy', () => {
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
const badTxData = `${txData.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
// execute transfer
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
erc1155ProxyWrapper.transferFromRawAsync(badTxData, authorized),
RevertReason.InvalidAssetDataEnd,
);
});
it('should revert if length of assetData, excluding the selector, is not a multiple of 32', async () => {
// setup test parameters
const tokensToTransfer = fungibleTokens.slice(0, 1);
const valuesToTransfer = [fungibleValueToTransferLarge];
const valueMultiplier = valueMultiplierSmall;
const erc1155ContractAddress = erc1155Wrapper.getContract().address;
const assetData = assetDataUtils.encodeERC1155AssetData(
erc1155ContractAddress,
tokensToTransfer,
valuesToTransfer,
receiverCallbackData,
);
const extraData = '01';
const assetDataWithExtraData = `${assetData}${extraData}`;
// execute transfer
await expectTransactionFailedAsync(
erc1155ProxyWrapper.transferFromAsync(
spender,
receiverContract,
erc1155Contract.address,
tokensToTransfer,
valuesToTransfer,
valueMultiplier,
receiverCallbackData,
authorized,
assetDataWithExtraData,
),
RevertReason.InvalidAssetDataLength,
);
});
it('should revert if length of assetData is less than 132 bytes', async () => {
@@ -1618,7 +1578,7 @@ describe('ERC1155Proxy', () => {
const zeros96Bytes = '0'.repeat(188);
const assetData131Bytes = `${AssetProxyId.ERC1155}${zeros96Bytes}`;
// execute transfer
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
erc1155ProxyWrapper.transferFromAsync(
spender,
receiverContract,
@@ -1630,7 +1590,6 @@ describe('ERC1155Proxy', () => {
authorized,
assetData131Bytes,
),
RevertReason.InvalidAssetDataLength,
);
});
it('should transfer nothing if value is zero', async () => {

View File

@@ -23,7 +23,7 @@ import {
} from '@0x/contracts-test-utils';
import { BlockchainLifecycle } from '@0x/dev-utils';
import { assetDataUtils } from '@0x/order-utils';
import { RevertReason } from '@0x/types';
import { AssetProxyId, RevertReason } from '@0x/types';
import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
@@ -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();
@@ -1329,7 +1334,7 @@ describe('Asset Transfer Proxies', () => {
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
const amounts = [erc20Amount, erc721Amount];
const nestedAssetData = [erc20AssetData, erc721AssetData];
const extraData = '0102030405060708';
const extraData = '0102030405060708090001020304050607080900010203040506070809000102';
const assetData = `${assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData)}${extraData}`;
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
assetData,
@@ -1624,6 +1629,120 @@ describe('Asset Transfer Proxies', () => {
RevertReason.SenderNotAuthorized,
);
});
it('should revert if asset data overflows beyond the bounds of calldata', async () => {
const inputAmount = new BigNumber(1);
const erc20Amount = new BigNumber(10);
const erc20AssetData = assetDataUtils.encodeERC20AssetData(erc20TokenA.address);
const erc721Amount = new BigNumber(1);
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
const amounts = [erc20Amount, erc721Amount];
const nestedAssetData = [erc20AssetData, erc721AssetData];
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
assetData,
fromAddress,
toAddress,
inputAmount,
);
// append asset data to end of tx data with a length of 0x300 bytes, which will extend past actual calldata.
const offsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000080';
const invalidOffsetToAssetData = '00000000000000000000000000000000000000000000000000000000000002a0';
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
const badData = `${data.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
// execute transfer
await expectTransactionFailedAsync(
web3Wrapper.sendTransactionAsync({
to: multiAssetProxy.address,
data: badData,
from: authorized,
}),
RevertReason.InvalidAssetDataEnd,
);
});
it('should revert if asset data resolves to a location beyond the bounds of calldata', async () => {
const inputAmount = new BigNumber(1);
const erc20Amount = new BigNumber(10);
const erc20AssetData = assetDataUtils.encodeERC20AssetData(erc20TokenA.address);
const erc721Amount = new BigNumber(1);
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
const amounts = [erc20Amount, erc721Amount];
const nestedAssetData = [erc20AssetData, erc721AssetData];
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
assetData,
fromAddress,
toAddress,
inputAmount,
);
const offsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000080';
const invalidOffsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000400';
const badData = data.replace(offsetToAssetData, invalidOffsetToAssetData);
// execute transfer
// note that this triggers `InvalidAssetDataLength` because the length is zero, otherwise it would
// trigger `InvalidAssetDataEnd`.
await expectTransactionFailedAsync(
web3Wrapper.sendTransactionAsync({
to: multiAssetProxy.address,
data: badData,
from: authorized,
}),
RevertReason.InvalidAssetDataLength,
);
});
it('should revert if length of assetData, excluding the selector, is not a multiple of 32', async () => {
// setup test parameters
const inputAmount = new BigNumber(1);
const erc20Amount = new BigNumber(10);
const erc20AssetData = assetDataUtils.encodeERC20AssetData(erc20TokenA.address);
const erc721Amount = new BigNumber(1);
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
const amounts = [erc20Amount, erc721Amount];
const nestedAssetData = [erc20AssetData, erc721AssetData];
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
const extraData = '01';
const assetDataWithExtraData = `${assetData}${extraData}`;
const badData = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
assetDataWithExtraData,
fromAddress,
toAddress,
inputAmount,
);
// execute transfer
await expectTransactionFailedAsync(
web3Wrapper.sendTransactionAsync({
to: multiAssetProxy.address,
data: badData,
from: authorized,
}),
RevertReason.InvalidAssetDataLength,
);
});
it('should revert if length of assetData is less than 68 bytes', async () => {
// setup test parameters
const inputAmount = new BigNumber(1);
// we'll construct asset data that has a 4 byte selector plus
// 32 byte payload. This results in asset data that is 36 bytes
// long and will trigger the `invalid length` error.
// we must be sure to use a # of bytes that is still %32
// so that we know the error is not triggered by another check in the code.
const zeros32Bytes = '0'.repeat(64);
const assetData36Bytes = `${AssetProxyId.MultiAsset}${zeros32Bytes}`;
const badData = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
assetData36Bytes,
fromAddress,
toAddress,
inputAmount,
);
// execute transfer
await expectTransactionFailedAsync(
web3Wrapper.sendTransactionAsync({
to: multiAssetProxy.address,
data: badData,
from: authorized,
}),
RevertReason.InvalidAssetDataLength,
);
});
});
});
});

View File

@@ -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 () => {
@@ -95,26 +97,12 @@ describe('StaticCallProxy', () => {
const invalidOffsetToAssetData = ethUtil.bufferToHex(paddedTxDataEndBuffer).slice(2);
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
const badTxData = `${txData.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
web3Wrapper.sendTransactionAsync({
to: staticCallProxy.address,
from: fromAddress,
data: badTxData,
}),
RevertReason.InvalidAssetDataEnd,
);
});
it('should revert if the length of assetData, excluding the proxyId, is not a multiple of 32', async () => {
const staticCallData = staticCallTarget.noInputFunction.getABIEncodedTransactionData();
const expectedResultHash = constants.KECCAK256_NULL;
const assetData = `${assetDataUtils.encodeStaticCallAssetData(
staticCallTarget.address,
staticCallData,
expectedResultHash,
)}01`;
await expectTransactionFailedAsync(
staticCallProxy.transferFrom.sendTransactionAsync(assetData, fromAddress, toAddress, amount),
RevertReason.InvalidAssetDataLength,
);
});
it('should revert if the length of assetData is less than 100 bytes', async () => {
@@ -125,9 +113,8 @@ describe('StaticCallProxy', () => {
.slice(0, -128);
const assetDataByteLen = (assetData.length - 2) / 2;
expect((assetDataByteLen - 4) % 32).to.equal(0);
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
staticCallProxy.transferFrom.sendTransactionAsync(assetData, fromAddress, toAddress, amount),
RevertReason.InvalidAssetDataLength,
);
});
it('should revert if the offset to `staticCallData` points to outside of assetData', async () => {
@@ -147,9 +134,8 @@ describe('StaticCallProxy', () => {
offsetToStaticCallData,
invalidOffsetToStaticCallData,
)}${newStaticCallData}`;
await expectTransactionFailedAsync(
await expectTransactionFailedWithoutReasonAsync(
staticCallProxy.transferFrom.sendTransactionAsync(badAssetData, fromAddress, toAddress, amount),
RevertReason.InvalidStaticCallDataOffset,
);
});
it('should revert if the callTarget attempts to write to state', async () => {
@@ -191,7 +177,7 @@ describe('StaticCallProxy', () => {
RevertReason.UnexpectedStaticCallResult,
);
});
it('should be successful if a function call with no inputs is successful', async () => {
it('should be successful if a function call with no inputs and no outputs is successful', async () => {
const staticCallData = staticCallTarget.noInputFunction.getABIEncodedTransactionData();
const expectedResultHash = constants.KECCAK256_NULL;
const assetData = assetDataUtils.encodeStaticCallAssetData(
@@ -201,6 +187,12 @@ describe('StaticCallProxy', () => {
);
await staticCallProxy.transferFrom.awaitTransactionSuccessAsync(assetData, fromAddress, toAddress, amount);
});
it('should be successful if the staticCallTarget is not a contract and no return value is expected', async () => {
const staticCallData = '0x0102030405060708';
const expectedResultHash = constants.KECCAK256_NULL;
const assetData = assetDataUtils.encodeStaticCallAssetData(toAddress, staticCallData, expectedResultHash);
await staticCallProxy.transferFrom.awaitTransactionSuccessAsync(assetData, fromAddress, toAddress, amount);
});
it('should be successful if a function call with one static input returns the correct value', async () => {
const staticCallData = staticCallTarget.isOddNumber.getABIEncodedTransactionData(new BigNumber(1));
const trueAsBuffer = ethUtil.toBuffer('0x0000000000000000000000000000000000000000000000000000000000000001');

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -1,4 +1,59 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "2.0.7",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "2.0.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563006338,
"version": "2.0.5",

View File

@@ -5,6 +5,30 @@ 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
## v2.0.7 - _July 15, 2019_
* Dependencies updated
## v2.0.6 - _July 13, 2019_
* Dependencies updated
## v2.0.5 - _July 13, 2019_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-coordinator",
"version": "2.0.5",
"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": "^2.1.0",
"@0x/contracts-gen": "^1.0.10",
"@0x/contracts-test-utils": "^3.1.8",
"@0x/dev-utils": "^2.2.4",
"@0x/sol-compiler": "^3.1.9",
"@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.1",
"@0x/contracts-asset-proxy": "^2.2.0",
"@0x/contracts-erc20": "^2.2.6",
"@0x/contracts-exchange": "^2.1.6",
"@0x/contracts-exchange-libs": "^3.0.0",
"@0x/contracts-utils": "^3.1.7",
"@0x/order-utils": "^8.2.0",
"@0x/types": "^2.4.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"ethereum-types": "^2.1.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.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.11"
},

View File

@@ -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,
);

View File

@@ -25,6 +25,7 @@ describe('Libs tests', () => {
artifacts.Coordinator,
provider,
txDefaults,
artifacts,
exchangeAddress,
);
});

View File

@@ -44,6 +44,7 @@ describe('Mixins tests', () => {
artifacts.Coordinator,
provider,
txDefaults,
artifacts,
exchangeAddress,
);
const accounts = await web3Wrapper.getAvailableAddressesAsync();

View File

@@ -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.`);

View File

@@ -1,4 +1,68 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "0.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "0.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563006338,
"version": "0.0.2",

View File

@@ -5,6 +5,34 @@ 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
## v0.0.4 - _July 15, 2019_
* Dependencies updated
## v0.0.3 - _July 13, 2019_
* Dependencies updated
## v0.0.2 - _July 13, 2019_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-dev-utils",
"version": "0.0.2",
"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": "^2.1.0",
"@0x/contract-wrappers": "^9.1.5",
"@0x/contracts-gen": "^1.0.10",
"@0x/contracts-test-utils": "^3.1.8",
"@0x/dev-utils": "^2.2.4",
"@0x/sol-compiler": "^3.1.9",
"@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,20 +69,20 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.1.1",
"@0x/contracts-asset-proxy": "^2.2.0",
"@0x/contracts-erc1155": "^1.1.7",
"@0x/contracts-erc20": "^2.2.6",
"@0x/contracts-erc721": "^2.1.7",
"@0x/contracts-exchange": "^2.1.6",
"@0x/contracts-exchange-libs": "^3.0.0",
"@0x/contracts-utils": "^3.1.7",
"@0x/order-utils": "^8.2.0",
"@0x/types": "^2.4.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"ethereum-types": "^2.1.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.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"ethereumjs-util": "^5.1.1"
},
"publishConfig": {

View File

@@ -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);

View File

@@ -37,6 +37,7 @@ describe('LibTransactionDecoder', () => {
artifacts.LibTransactionDecoder,
provider,
txDefaults,
artifacts,
);
});
after(async () => {

View File

@@ -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,
);

View File

@@ -1,4 +1,59 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "1.1.9",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "1.1.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563006338,
"version": "1.1.7",

View File

@@ -5,6 +5,30 @@ 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
## v1.1.9 - _July 15, 2019_
* Dependencies updated
## v1.1.8 - _July 13, 2019_
* Dependencies updated
## v1.1.7 - _July 13, 2019_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-erc1155",
"version": "1.1.7",
"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": "^2.1.0",
"@0x/contracts-gen": "^1.0.10",
"@0x/dev-utils": "^2.2.4",
"@0x/sol-compiler": "^3.1.9",
"@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,14 +68,14 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.1.1",
"@0x/contracts-test-utils": "^3.1.8",
"@0x/contracts-utils": "^3.1.7",
"@0x/types": "^2.4.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"ethereum-types": "^2.1.3",
"@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.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},
"publishConfig": {

View File

@@ -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

View File

@@ -1,4 +1,59 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "2.2.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "2.2.7",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563006338,
"version": "2.2.6",

View File

@@ -5,6 +5,30 @@ 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
## v2.2.8 - _July 15, 2019_
* Dependencies updated
## v2.2.7 - _July 13, 2019_
* Dependencies updated
## v2.2.6 - _July 13, 2019_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-erc20",
"version": "2.2.6",
"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": "^2.1.0",
"@0x/contracts-gen": "^1.0.10",
"@0x/contracts-test-utils": "^3.1.8",
"@0x/dev-utils": "^2.2.4",
"@0x/sol-compiler": "^3.1.9",
"@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.1",
"@0x/contracts-utils": "^3.1.7",
"@0x/types": "^2.4.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"ethereum-types": "^2.1.3",
"@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.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},
"publishConfig": {

View File

@@ -37,6 +37,7 @@ describe('UnlimitedAllowanceToken', () => {
artifacts.DummyERC20Token,
provider,
txDefaults,
artifacts,
constants.DUMMY_TOKEN_NAME,
constants.DUMMY_TOKEN_SYMBOL,
constants.DUMMY_TOKEN_DECIMALS,

View File

@@ -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();

View File

@@ -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 () => {

View File

@@ -1,4 +1,59 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "2.1.9",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "2.1.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563006338,
"version": "2.1.7",

View File

@@ -5,6 +5,30 @@ 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
## v2.1.9 - _July 15, 2019_
* Dependencies updated
## v2.1.8 - _July 13, 2019_
* Dependencies updated
## v2.1.7 - _July 13, 2019_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-erc721",
"version": "2.1.7",
"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": "^2.1.0",
"@0x/contracts-gen": "^1.0.10",
"@0x/contracts-test-utils": "^3.1.8",
"@0x/dev-utils": "^2.2.4",
"@0x/sol-compiler": "^3.1.9",
"@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.1",
"@0x/contracts-utils": "^3.1.7",
"@0x/types": "^2.4.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"ethereum-types": "^2.1.3",
"@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.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},
"publishConfig": {

View File

@@ -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;

View File

@@ -1,4 +1,59 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "3.0.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "3.0.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563006338,
"version": "3.0.4",

View File

@@ -5,6 +5,30 @@ 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
## v3.0.6 - _July 15, 2019_
* Dependencies updated
## v3.0.5 - _July 13, 2019_
* Dependencies updated
## v3.0.4 - _July 13, 2019_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-exchange-forwarder",
"version": "3.0.4",
"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": "^2.1.0",
"@0x/contract-wrappers": "^9.1.5",
"@0x/contracts-gen": "^1.0.10",
"@0x/contracts-test-utils": "^3.1.8",
"@0x/dev-utils": "^2.2.4",
"@0x/sol-compiler": "^3.1.9",
"@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,19 +68,19 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.1.1",
"@0x/contracts-asset-proxy": "^2.2.0",
"@0x/contracts-erc20": "^2.2.6",
"@0x/contracts-erc721": "^2.1.7",
"@0x/contracts-exchange": "^2.1.6",
"@0x/contracts-exchange-libs": "^3.0.0",
"@0x/contracts-utils": "^3.1.7",
"@0x/order-utils": "^8.2.0",
"@0x/types": "^2.4.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"ethereum-types": "^2.1.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.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},
"publishConfig": {

View File

@@ -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,

View File

@@ -1,4 +1,59 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "3.0.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "3.0.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "3.0.0",
"changes": [

View File

@@ -5,6 +5,30 @@ 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
## v3.0.2 - _July 15, 2019_
* Dependencies updated
## v3.0.1 - _July 13, 2019_
* Dependencies updated
## v3.0.0 - _July 13, 2019_
* Move `LibTransactionDecoder` to contracts/dev-utils package (#1848)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-exchange-libs",
"version": "3.0.0",
"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": "^2.1.0",
"@0x/contracts-gen": "^1.0.10",
"@0x/contracts-test-utils": "^3.1.8",
"@0x/dev-utils": "^2.2.4",
"@0x/sol-compiler": "^3.1.9",
"@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.1",
"@0x/contracts-utils": "^3.1.7",
"@0x/order-utils": "^8.2.0",
"@0x/types": "^2.4.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"ethereum-types": "^2.1.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.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},
"publishConfig": {

View File

@@ -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,

View File

@@ -1,4 +1,59 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "2.1.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "2.1.7",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563006338,
"version": "2.1.6",

View File

@@ -5,6 +5,30 @@ 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
## v2.1.8 - _July 15, 2019_
* Dependencies updated
## v2.1.7 - _July 13, 2019_
* Dependencies updated
## v2.1.6 - _July 13, 2019_
* Dependencies updated

View File

@@ -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
}

View File

@@ -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;
}
}

View File

@@ -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

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-exchange",
"version": "2.1.6",
"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": "^2.1.0",
"@0x/contracts-gen": "^1.0.10",
"@0x/contracts-test-utils": "^3.1.8",
"@0x/dev-utils": "^2.2.4",
"@0x/sol-compiler": "^3.1.9",
"@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,19 +69,19 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.1.1",
"@0x/contracts-asset-proxy": "^2.2.0",
"@0x/contracts-erc1155": "^1.1.7",
"@0x/contracts-erc20": "^2.2.6",
"@0x/contracts-erc721": "^2.1.7",
"@0x/contracts-exchange-libs": "^3.0.0",
"@0x/contracts-utils": "^3.1.7",
"@0x/order-utils": "^8.2.0",
"@0x/types": "^2.4.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"ethereum-types": "^2.1.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.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.11"
},

View File

@@ -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 () => {

View File

@@ -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(

View File

@@ -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),

View File

@@ -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 () => {

View File

@@ -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 () => {

View File

@@ -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;

View 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,
};

View File

@@ -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,

View File

@@ -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(

View File

@@ -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,
);

View File

@@ -1,4 +1,59 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "4.0.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "4.0.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "4.0.0",
"changes": [

View File

@@ -5,6 +5,30 @@ 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
## v4.0.2 - _July 15, 2019_
* Dependencies updated
## v4.0.1 - _July 13, 2019_
* Dependencies updated
## v4.0.0 - _July 13, 2019_
* Move `OrderValidator` to contracts/dev-utils package as `OrderValidationUtils` (#1848)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-extensions",
"version": "4.0.0",
"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": "^2.1.0",
"@0x/contract-wrappers": "^9.1.5",
"@0x/contracts-gen": "^1.0.10",
"@0x/contracts-test-utils": "^3.1.8",
"@0x/dev-utils": "^2.2.4",
"@0x/sol-compiler": "^3.1.9",
"@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.1",
"@0x/contracts-asset-proxy": "^2.2.0",
"@0x/contracts-erc20": "^2.2.6",
"@0x/contracts-erc721": "^2.1.7",
"@0x/contracts-exchange": "^2.1.6",
"@0x/contracts-exchange-libs": "^3.0.0",
"@0x/contracts-utils": "^3.1.7",
"@0x/order-utils": "^8.2.0",
"@0x/types": "^2.4.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"ethereum-types": "^2.1.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.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},
"publishConfig": {

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,
);

View File

@@ -1,4 +1,59 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "3.1.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "3.1.7",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563006338,
"version": "3.1.6",

View File

@@ -5,6 +5,30 @@ 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
## v3.1.8 - _July 15, 2019_
* Dependencies updated
## v3.1.7 - _July 13, 2019_
* Dependencies updated
## v3.1.6 - _July 13, 2019_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-multisig",
"version": "3.1.6",
"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": "^2.1.0",
"@0x/contracts-gen": "^1.0.10",
"@0x/contracts-test-utils": "^3.1.8",
"@0x/dev-utils": "^2.2.4",
"@0x/sol-compiler": "^3.1.9",
"@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,15 +69,15 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.1.1",
"@0x/contracts-asset-proxy": "^2.2.0",
"@0x/contracts-erc20": "^2.2.6",
"@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.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"ethereum-types": "^2.1.3",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},
"publishConfig": {

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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);

View File

@@ -1,4 +1,58 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "3.1.10",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "3.1.9",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "3.1.8",
"changes": [

View File

@@ -5,6 +5,30 @@ 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
## v3.1.10 - _July 15, 2019_
* Dependencies updated
## v3.1.9 - _July 13, 2019_
* Dependencies updated
## v3.1.8 - _July 13, 2019_
* Fixed false positives in `expectTransactionFailedAsync` and `expectContractCallFailedAsync` (#1852)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-test-utils",
"version": "3.1.8",
"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.4",
"@0x/order-utils": "^8.2.0",
"@0x/sol-compiler": "^3.1.9",
"@0x/sol-coverage": "^3.0.6",
"@0x/sol-profiler": "^3.1.8",
"@0x/sol-trace": "^2.0.14",
"@0x/subproviders": "^4.1.1",
"@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.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@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",
@@ -62,7 +63,7 @@
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",
"dirty-chai": "^2.0.1",
"ethereum-types": "^2.1.3",
"ethereum-types": "^2.1.4",
"ethereumjs-util": "^5.1.1",
"ethers": "~4.0.4",
"js-combinatorics": "^0.5.3",

View File

@@ -1,4 +1,63 @@
[
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563193019,
"version": "3.1.9",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563047529,
"version": "3.1.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1563006338,
"version": "3.1.7",

View File

@@ -5,6 +5,31 @@ 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
## v3.1.9 - _July 15, 2019_
* Dependencies updated
## v3.1.8 - _July 13, 2019_
* Dependencies updated
## v3.1.7 - _July 13, 2019_
* Dependencies updated

View File

@@ -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"
]
}

View 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();
}
}

View 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");
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-utils",
"version": "3.1.7",
"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": "^2.1.0",
"@0x/contracts-gen": "^1.0.10",
"@0x/contracts-test-utils": "^3.1.8",
"@0x/dev-utils": "^2.2.4",
"@0x/sol-compiler": "^3.1.9",
"@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,14 +70,14 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.1.1",
"@0x/order-utils": "^8.2.0",
"@0x/types": "^2.4.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",
"@0x/web3-wrapper": "^6.0.7",
"@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.5.0",
"@0x/web3-wrapper": "^6.0.11",
"bn.js": "^4.11.8",
"ethereum-types": "^2.1.3",
"ethereum-types": "^2.1.4",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.11"
},

View File

@@ -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,
};

View File

@@ -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';

View File

@@ -28,6 +28,7 @@ describe('LibAddressArray', () => {
artifacts.TestLibAddressArray,
provider,
txDefaults,
artifacts,
);
});
after(async () => {

Some files were not shown because too many files have changed in this diff Show More