Compare commits

...

2170 Commits

Author SHA1 Message Date
fabioberger
2b8226a757 Publish
- @0x/contracts-asset-proxy@2.2.7
 - @0x/contracts-coordinator@2.0.12
 - @0x/contracts-dev-utils@0.0.9
 - @0x/contracts-erc1155@1.1.14
 - @0x/contracts-erc20@2.2.13
 - @0x/contracts-erc721@2.1.14
 - @0x/contracts-exchange-forwarder@3.0.11
 - @0x/contracts-exchange-libs@3.0.7
 - @0x/contracts-exchange@2.1.13
 - @0x/contracts-extensions@4.0.7
 - @0x/contracts-multisig@3.1.13
 - @0x/contracts-test-utils@3.1.15
 - @0x/contracts-utils@3.2.3
 - 0x.js@7.0.1
 - @0x/abi-gen-wrappers@5.3.1
 - @0x/abi-gen@4.2.0
 - @0x/assert@2.1.5
 - @0x/asset-buyer@6.1.13
 - @0x/asset-swapper@1.0.3
 - @0x/base-contract@5.3.3
 - @0x/connect@5.0.18
 - @0x/contract-artifacts@2.2.1
 - @0x/contract-wrappers@12.0.0
 - @0x/contracts-gen@1.0.14
 - @0x/dev-tools-pages@0.0.30
 - @0x/dev-utils@2.3.2
 - ethereum-types@2.1.5
 - @0x/fill-scenarios@3.0.18
 - @0x/instant@1.0.30
 - @0x/json-schemas@4.0.1
 - @0x/migrations@4.3.1
 - @0x/monorepo-scripts@1.0.36
 - @0x/order-utils@8.3.1
 - @0x/sol-compiler@3.1.14
 - @0x/sol-coverage@3.0.11
 - @0x/sol-doc@2.0.18
 - @0x/sol-profiler@3.1.13
 - @0x/sol-resolver@2.0.10
 - @0x/sol-trace@2.0.19
 - @0x/sol-tracing-utils@6.0.18
 - @0x/sra-spec@2.0.16
 - @0x/subproviders@5.0.3
 - @0x/testnet-faucets@1.0.86
 - @0x/types@2.4.2
 - @0x/typescript-typings@4.2.5
 - @0x/utils@4.5.1
 - @0x/web3-wrapper@6.0.12
 - @0x/website@0.0.89
2019-09-03 16:46:00 +02:00
fabioberger
92d5adaac4 Updated CHANGELOGS & MD docs 2019-09-03 16:45:49 +02:00
Fabio B
0c9daa693e Merge pull request #2023 from 0xProject/feature/new-docs
Docs 2.0
2019-09-03 15:25:47 +02:00
fabioberger
89729e828c Print out which snapshot version is being downloaded 2019-09-03 14:29:24 +02:00
Piotr Janosz
c2113caae1 Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-09-03 14:29:06 +02:00
Piotr Janosz
e0adb6624d Check if link is a valid url in mdx inline link: if so, open in a new tab, if not, same tab. 2019-09-03 14:28:55 +02:00
fabioberger
022855add0 Remove use of remove type 2019-09-03 13:27:04 +02:00
fabioberger
4dd1c48dc8 Increase the memory allocation for building the website 2019-09-03 13:08:05 +02:00
fabioberger
cdc2393aa6 Fix prettier 2019-09-03 12:57:57 +02:00
fabioberger
94f94bdda7 Add contract-wrappers MD docs and update it's index.ts so that no types are missing 2019-09-03 12:43:27 +02:00
fabioberger
3264bd223d Final update of reference docs 2019-09-03 12:30:05 +02:00
fabioberger
6292c0703c Export more of abi-gen-wrappers from contract-wrappers 2019-09-03 12:26:19 +02:00
fabioberger
9a28079f2a Re-wrote Ganache Setup guide into a Setting up a local 0x testnet guide 2019-09-03 12:26:01 +02:00
fabioberger
c612649f02 Update Web3 Provider Explained guide 2019-09-03 12:24:13 +02:00
fabioberger
eda44d1ffb Update market-making guide to mention Mesh as an alternative to SRA 2019-09-03 12:23:58 +02:00
fabioberger
4c2f77c014 Update contract addresses 2019-09-03 10:53:33 +02:00
fabioberger
6b8bbd3d5f Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-09-03 10:40:00 +02:00
fabioberger
e914e1b7fa Increase available memory for webpack 2019-09-03 10:39:55 +02:00
Fabio B
3d2ce749a8 Merge branch 'development' into feature/new-docs 2019-09-02 23:38:31 +02:00
Piotr Janosz
9892d8d6d2 Added keeping active link in view when scrolling content in the docs 2019-09-02 18:15:39 +02:00
fabioberger
218a7ab810 Remove bundle dirs too 2019-09-02 16:22:45 +02:00
fabioberger
6779e52813 Update ganache-cli to later version 2019-09-02 16:22:36 +02:00
Piotr Janosz
5d51b40541 Simplified table of contents 2019-09-02 15:34:56 +02:00
Piotr Janosz
b12b7069f7 Added a performance comment 2019-09-02 14:56:14 +02:00
Piotr Janosz
10a5d38446 Rendering sidebar on mobile without any event listeners / taxing calculations / changes in height 2019-09-02 14:54:32 +02:00
Piotr Janosz
e39e7a934e Added scrollbar size adjustment on resize / scroll 2019-09-02 14:39:15 +02:00
Piotr Janosz
b7127d8506 Merge branch 'feature/new-docs' into feature/new-docs-scrollbar-test 2019-09-02 11:38:15 +02:00
Piotr Janosz
a12e07b1a8 Removed a comment 2019-09-02 11:37:47 +02:00
Piotr Janosz
8ff5c0a603 Changed the order of indices in search suggestions 2019-09-02 11:33:36 +02:00
fabioberger
d7c61fea4c Fix prettier in algolia_meta 2019-09-01 12:17:15 +02:00
fabioberger
08dc5fafa0 Fix prettier 2019-09-01 12:03:23 +02:00
fabioberger
78493a9d98 Update Algolia to production account 2019-09-01 12:03:13 +02:00
fabioberger
e274d8994a Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-09-01 11:58:00 +02:00
fabioberger
2dee887e6f Update abi-gen-wrappers dep version 2019-09-01 11:57:49 +02:00
Piotr Janosz
f7eb20a235 Created a color scheme for code snippets. Fixed language not being passed to some code blocks in two guides. 2019-08-31 22:27:33 +02:00
fabioberger
f3cea0ebd0 Update outdating dep version 2019-08-31 15:34:28 +02:00
fabioberger
05e00d278f Fix prettier 2019-08-31 15:20:39 +02:00
fabioberger
107c7a71f9 Remove unused import 2019-08-31 14:44:13 +02:00
fabioberger
56698fb09e Remove unused imports 2019-08-31 12:48:26 +02:00
fabioberger
55bb6f89d3 Remove unused import 2019-08-31 12:15:34 +02:00
fabioberger
47d77cbddd Remove unused code 2019-08-31 11:20:08 +02:00
fabioberger
2547e0e5b1 Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-31 11:17:49 +02:00
fabioberger
1a4699ecac update yarn.lock 2019-08-31 11:17:39 +02:00
fabioberger
c825643b67 Update ts-doc-gen version to one that fixes issues with Object Literals and removes Hierarchy sections and Module headers 2019-08-31 11:16:21 +02:00
Piotr Janosz
a425d3a234 Removed the isCommunity filter / custom filter labels functionality (only used for that before) 2019-08-30 23:22:48 +02:00
Chris Kalani
3041e7459e Open legal guide in same window 2019-08-30 13:24:37 -07:00
Chris Kalani
1fb9d54174 Removed the word wiki from resources dropdown 2019-08-30 13:23:47 -07:00
Chris Kalani
598607f5a3 Sneaking in updated product dropdown menu titles based on Will's feedback 2019-08-30 13:22:42 -07:00
Chris Kalani
5c5bb20415 Nevermind, changed back to Trader 2019-08-30 11:57:10 -07:00
Chris Kalani
6199a17791 Changed trader keyword to trading 2019-08-30 11:52:56 -07:00
Chris Kalani
7dd42ad6aa Changed references from Asset Buyer to Asset Swapper 2019-08-30 11:49:16 -07:00
Chris Kalani
c7fd85633d Changed tools to Tools & Libraries - top nav left as just tools 2019-08-30 11:44:18 -07:00
fabioberger
b3df71bebf Several additional fixes to the reference MDX docs 2019-08-30 20:35:41 +02:00
Piotr Janosz
88d95ebdbc Correctly copying code samples 2019-08-30 20:04:35 +02:00
fabioberger
140cf4d378 Remove generated docs in clean 2019-08-30 17:18:58 +02:00
fabioberger
451a19117f Fix MD docs and make sure generated contract wrappers are being rendered 2019-08-30 17:18:40 +02:00
fabioberger
aa6ab33b93 Remove doc gen from abi-gen-wrappers since it'll be tested via contract-wrappers 2019-08-30 14:09:39 +02:00
fabioberger
8ec04271f3 Fix casing of PyPI 2019-08-30 12:59:37 +02:00
fabioberger
f583de652f Fix casing on TypeScript 2019-08-30 12:58:05 +02:00
fabioberger
96cd9de8a6 Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-30 12:50:17 +02:00
fabioberger
9a17cb4c92 Remove unnecessary link 2019-08-30 12:50:03 +02:00
Piotr Janosz
021cba9fad Fixed some types 2019-08-30 00:00:23 +02:00
Piotr Janosz
47f4321611 Adjust scrollbar / toc height to available space 2019-08-29 23:58:18 +02:00
Piotr Janosz
775a41a789 Changed line-height to 1.6 for paragraph 2019-08-29 23:04:33 +02:00
Piotr Janosz
f6c61ed79f Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-29 20:38:28 +02:00
Piotr Janosz
152e057e08 Unbroke build process / generating toc 2019-08-29 20:38:05 +02:00
fabioberger
8b84ecc593 Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-29 20:23:26 +02:00
fabioberger
9c10babefd Use a different babel plugin that works in a production webpack build 2019-08-29 20:23:11 +02:00
Piotr Janosz
67193d9472 Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-29 20:06:30 +02:00
Piotr Janosz
7d04dd9520 Fixed styles for table of contents 2019-08-29 20:04:50 +02:00
Piotr Janosz
93bda7972c Fixed an issue with other nodes than text being parsed incorrectly in the table of contents 2019-08-29 19:59:45 +02:00
fabioberger
92c0e34ed2 Fix header sizes to display optimally in sidebar 2019-08-29 19:20:54 +02:00
fabioberger
c0a471b349 Update README links 2019-08-29 18:54:06 +02:00
fabioberger
2543076d16 Replace 0xproject.com urls with 0x.org 2019-08-29 18:36:48 +02:00
fabioberger
e32bb6fc0f Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-29 18:32:03 +02:00
fabioberger
7020166473 Update ts-doc-gen and the reference docs 2019-08-29 18:30:45 +02:00
Piotr Janosz
16ae47f2ad Adjusted font-size for paragraph, ordered and unordered lists. Fixed line-heights and colors too. 2019-08-29 18:28:26 +02:00
fabioberger
abf1141ad8 Fix prettier 2019-08-29 17:54:12 +02:00
Piotr Janosz
3790e0a741 Autolink headings in mdx only up to h3. Added heading sizes (in px) for h4,h5,h6 in mdx headings 2019-08-29 17:43:56 +02:00
Piotr Janosz
9e1966b4fe Smoother animation on active table of contents state change 2019-08-29 17:32:19 +02:00
Piotr Janosz
38e06e57a3 Extracted common styles for levels of nesting deeper than 1 in the mdx table of contents 2019-08-29 17:27:34 +02:00
Piotr Janosz
7f2fc90677 Merge branch 'feature/docs-third-level-nesting' into feature/new-docs 2019-08-29 17:24:26 +02:00
Piotr Janosz
1f0ab54fc5 Revert webpack config 2019-08-29 17:23:17 +02:00
fabioberger
7f8c11a74c Remove unused variables 2019-08-29 15:39:53 +02:00
fabioberger
7a4d64d90d Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-29 14:20:41 +02:00
fabioberger
7217bfa35e Fix links in guides 2019-08-29 14:20:04 +02:00
fabioberger
25077affc8 Link Python tools to doc pages not PyPi 2019-08-29 14:19:52 +02:00
fabioberger
7a80583655 Open help link in new tab 2019-08-29 14:19:20 +02:00
Piotr Janosz
c21fe0cb50 Thrid level of nesting / temporary webpack config 2019-08-29 13:33:52 +02:00
Piotr Janosz
3d08e79089 Fixed a bug in algolia_meta 2019-08-29 11:45:56 +02:00
fabioberger
c43db2d096 Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-29 11:15:43 +02:00
Chris Kalani
220856d084 Added bug bounty program guide 2019-08-28 16:23:35 -07:00
Chris Kalani
a01eafa4e7 Cleaned up some Guide titles 2019-08-28 16:11:50 -07:00
Chris Kalani
f9c2d25352 Cleaned up CLI tag and added link to tools on API page 2019-08-28 16:08:52 -07:00
fabioberger
d2f77d74e6 Remove hr so we don't have a bunch in a row 2019-08-29 01:04:16 +02:00
fabioberger
c3b928c1f5 Prettier fix 2019-08-29 00:44:10 +02:00
fabioberger
9dfa9c194e Remove "Relayers" topic/tag 2019-08-29 00:17:11 +02:00
fabioberger
1a3dc6cefc Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-29 00:13:19 +02:00
fabioberger
1a73daf82a Update doc references 2019-08-29 00:09:27 +02:00
fabioberger
6b20c9a542 Update ts-doc-gen so that it properly converts module relative links to anchor links 2019-08-29 00:04:39 +02:00
Piotr Janosz
76c996250d Sorting tools by difficulty and alphabetically. Removed icons from featured tools. Extracted common difficultyOrder constant 2019-08-28 23:21:37 +02:00
Piotr Janosz
52e8de9966 Pushed sorting guides titles case-insensitive 2019-08-28 22:30:49 +02:00
Piotr Janosz
81ab84b087 Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-28 22:18:57 +02:00
Piotr Janosz
e34755a1ef Sorting guides by difficulty and alphabetically 2019-08-28 22:18:39 +02:00
fabioberger
6c11b2ad8a Remove committed reference file 2019-08-28 21:57:35 +02:00
fabioberger
ede6ecc3aa Add "On-chain" prefix to section name 2019-08-28 21:55:37 +02:00
fabioberger
9db69f33e4 Add blurb about on-chain API Explorer 2019-08-28 21:55:13 +02:00
fabioberger
17d5d4648b Remove order-watcher reference doc 2019-08-28 21:42:01 +02:00
fabioberger
e203b5593a Update tool naming to be more human readable 2019-08-28 21:41:36 +02:00
fabioberger
de9aa063c0 Link 0x.js to it's reference page 2019-08-28 21:41:08 +02:00
fabioberger
077d001b42 Hide tools from homepage that have isHidden flag 2019-08-28 20:31:15 +02:00
fabioberger
dfd46d68ac Update reference.mdx files 2019-08-28 18:54:06 +02:00
fabioberger
4dbe137999 Add more packages to those we generate docs for and remove unused flags 2019-08-28 18:53:45 +02:00
fabioberger
1ac5cb404f Remove duplicate algolia_meta 2019-08-28 18:53:22 +02:00
fabioberger
43ffa2dd77 Write algolia_metadata to utils dir 2019-08-28 18:53:13 +02:00
fabioberger
1efa7935b7 Add back logic to prune out private methods 2019-08-28 18:52:56 +02:00
fabioberger
b0835b005a Pass in provider, not Web3Wrapper 2019-08-28 18:52:39 +02:00
fabioberger
30946ac110 Update ts-doc-gen 2019-08-28 18:12:18 +02:00
fabioberger
9427858755 Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-28 18:09:42 +02:00
fabioberger
53864d3817 Refactor doc generation script to only generate MD docs and to have them reflect what is exported in their respective index.ts files 2019-08-28 18:09:29 +02:00
Piotr Janosz
ab283ddd9b Added autolinking headings in mdx docs 2019-08-28 17:44:46 +02:00
fabioberger
7efcf9066c Change CoordinatorWrapper constructor to take a provider 2019-08-28 17:11:16 +02:00
Piotr Janosz
219e09d157 Stylstic fix for the new way we sectionize headings / table of contents 2019-08-28 12:14:05 +02:00
Piotr Janosz
d816551dba Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-28 11:45:55 +02:00
Piotr Janosz
04c5752b8a Fixed sectionizing headings in docs: Nested sections do not get wrapped in parent sections anymore; only sectionizing headings that need to be sectionized (i.e. that appear in the table of contents) 2019-08-28 11:45:41 +02:00
Chris Kalani
ed12d8b95f Started updating tool titles 2019-08-27 15:32:35 -07:00
Chris Kalani
f48852742d Cleaned up core concept illustrations 2019-08-27 15:13:39 -07:00
Chris Kalani
b84d89367a Fixed huge width on instant screenshot 2019-08-27 14:09:07 -07:00
Piotr Janosz
d8dab6a070 Merge branch 'feature/new-docs' of github.com:0xProject/0x-monorepo into feature/new-docs 2019-08-27 18:46:46 +02:00
Piotr Janosz
ac2443690c Fixed regex to not remove hashes on links beyond the initial one 2019-08-27 18:46:34 +02:00
fabioberger
5df0f13eb0 Fix links in Core Concepts 2019-08-27 18:33:14 +02:00
fabioberger
24d782fb19 Remove deployer endpoint that is no longer used 2019-08-27 17:55:08 +02:00
fabioberger
01a5472318 Fix all /docs/{pkg} links to /docs/tools/{pkg} 2019-08-27 17:49:29 +02:00
fabioberger
4b7a2e9d49 Replace all links to wiki with links to guides section 2019-08-27 17:25:58 +02:00
fabioberger
62936e3502 Add 0x Extensions guide 2019-08-27 16:11:22 +02:00
fabioberger
d6b3e4fbaa Fix Get Started links 2019-08-27 15:33:25 +02:00
fabioberger
a5f011f4a4 Add MMing guide 2019-08-27 15:33:18 +02:00
fabioberger
c6efaab01d Add all guides to the sitemap.txt 2019-08-27 14:45:12 +02:00
fabioberger
0f7282d9a9 Prettier fix 2019-08-27 12:15:02 +02:00
fabioberger
a3b414a986 Ignore auto-generated MDX in website repo 2019-08-27 11:56:50 +02:00
fabioberger
8a6d0b67f1 Update Guides 2019-08-27 11:55:39 +02:00
fabioberger
f78ff91975 Add missing new line 2019-08-27 10:46:40 +02:00
fabioberger
c8e416f3b1 Fix TS error 2019-08-27 10:46:24 +02:00
fabioberger
d61f67d24a Remove unused components 2019-08-27 10:46:13 +02:00
fabioberger
258ffdcc94 Update doc links 2019-08-27 10:45:47 +02:00
fabioberger
1f93f09864 Combine @0x/utils exports 2019-08-27 10:45:30 +02:00
fabioberger
7afddb9309 Fix prettier 2019-08-27 10:29:47 +02:00
fabioberger
5eb4dbd5d9 Fix links 2019-08-27 10:29:42 +02:00
fabioberger
fc39ddfb71 Remove old doc md files 2019-08-27 10:29:30 +02:00
fabioberger
ba04a8bc0c Revert react and react-dom versions in Instant 2019-08-27 10:08:28 +02:00
fabioberger
02d4a28402 Fix clean command to remove bundles recursively 2019-08-27 10:08:08 +02:00
fabioberger
ea2bf07ea6 Fix linter errors 2019-08-26 19:35:57 +02:00
fabioberger
b5dc734dc4 Remove legacy doc pages 2019-08-26 19:22:48 +02:00
fabioberger
7dd9b0ba66 Improve indexing comment 2019-08-26 18:09:42 +02:00
fabioberger
69a5c8a317 Use yarn because otherwise the flags don't get passed down properly 2019-08-26 18:08:11 +02:00
fabioberger
b975ac7c31 Fix search and indexing 2019-08-26 17:51:38 +02:00
Piotr Janosz
dcede832c8 Removed webpack bundle analyzer 2019-08-26 16:59:27 +02:00
Piotr Janosz
f40bbbc238 Fixed 404 display for docs pages 2019-08-26 16:55:29 +02:00
fabioberger
361f5ca5cc Segregate indexes by environment 2019-08-26 16:25:40 +02:00
fabioberger
a710ebe5b3 Remove scripts gitignore since we don't have monorepo scripts in each package anymore 2019-08-26 16:18:21 +02:00
fabioberger
2becef23ff Add note about admin API env var needed for indexing docs 2019-08-26 14:50:40 +02:00
fabioberger
f916d293fa Add updating tools from S3 and indexing content on Algolia to deployment commands 2019-08-26 14:48:06 +02:00
fabioberger
f312a260cc Move out Algolia indexing command-line tool out of website and remove need to expose admin key 2019-08-26 14:41:40 +02:00
fabioberger
fd9b51c7db Redirect old docs pages and wiki to new doc pages 2019-08-26 13:57:05 +02:00
fabioberger
1dac6b6157 Gitignore the tool MDX files in website repo 2019-08-26 10:28:34 +02:00
fabioberger
c2ba6b3a0f Update the tools MDX files from authoritative S3 before build and dev server start 2019-08-26 10:28:21 +02:00
fabioberger
576bd5585f Add Golang Mesh RPC package and update versions 2019-08-26 10:16:43 +02:00
fabioberger
ae61a87190 merge development 2019-08-26 08:46:37 +02:00
fabioberger
2e8f2ae769 Update yarn.lock 2019-08-26 08:24:18 +02:00
fabioberger
b507a308e6 Fix home route 2019-08-26 08:20:29 +02:00
Fabio B
ad83b17fdf Merge pull request #2033 from 0xProject/feature/genMDDocs
Generate MD docs for all packages
2019-08-26 08:08:17 +02:00
fabioberger
e452cfcd59 Final docs gen 2019-08-26 07:11:29 +02:00
fabioberger
6474a4e08c Update ts-doc-gen with fix for multi-link lines 2019-08-26 07:10:11 +02:00
fabioberger
e78288ddfd Update yarn.lock 2019-08-25 22:34:34 +02:00
fabioberger
6e2d0ab13d Update docs to latest format 2019-08-25 22:34:28 +02:00
fabioberger
bfbc78c95c Remove unused dep 2019-08-25 22:14:08 +02:00
fabioberger
368ae86530 Add MD docs diff test to CI 2019-08-24 01:27:24 +02:00
fabioberger
d8ccc1694d merge development 2019-08-24 01:21:34 +02:00
fabioberger
b4e10b1e06 Update yarn.lock 2019-08-24 01:19:22 +02:00
fabioberger
05f76958ac Remove legacy FAQ 2019-08-24 01:19:15 +02:00
Piotr Janosz
1183cf5e6b Replaced images for core concepts. Fixed a bug causing duplicate props on image and its container in mdx 2019-08-24 00:06:30 +02:00
Piotr Janosz
bf9eb1413b Added animation wrapper with positioning props. Updated animations for core concepts. 2019-08-24 00:06:30 +02:00
Piotr Janosz
38d48a8f20 Moved @0x/types back to dependencies. 2019-08-24 00:06:30 +02:00
Piotr Janosz
ca222a470d Added opening step links in new tab if the url is valid 2019-08-24 00:06:08 +02:00
Piotr Janosz
49ca8840ea Moved animations to public and compressed files 2019-08-24 00:06:08 +02:00
Piotr Janosz
faaeba78bb Removed unused make-promises-safe package 2019-08-24 00:06:08 +02:00
Piotr Janosz
6c37d47f2f Replaced react loadable (only used in Icon) with the native react lazy / suspense. Removed loadable nad its types from package.json 2019-08-24 00:06:08 +02:00
Piotr Janosz
185e53149f Moves @0x/types and @0x/typescript-typings to devDependencies 2019-08-24 00:06:08 +02:00
Piotr Janosz
4329a252ee Removed react-tap-event types as it's not used anymore. Reinstalled node-sass as a dev dependency as it's needed by sass-loader 2019-08-24 00:05:36 +02:00
Piotr Janosz
8d38d69684 Removed unused package react-typist 2019-08-24 00:05:36 +02:00
Piotr Janosz
edb5e50253 Removed unused package react-lazyload 2019-08-24 00:05:36 +02:00
Piotr Janosz
81ab2e75ca Removed unusued node-sass package. Left sass-loader for webpack intact. 2019-08-24 00:05:36 +02:00
Piotr Janosz
e0d8398cf7 Removed unused less node package, adjusted less loader rules to match other loaders in webpack config 2019-08-24 00:05:36 +02:00
Piotr Janosz
4fd46d1c95 Removed unused jsonschema / @types/jsonschema packages 2019-08-24 00:05:36 +02:00
Piotr Janosz
c217764fe0 Removed unusued pkg: body-scroll-lock 2019-08-24 00:05:35 +02:00
Piotr Janosz
42124274c7 Webpack changes: using eval-source-map for development, added parallel option to Terser plugin, added cache loader and caching directory to mdx / babel loaders. 2019-08-24 00:05:35 +02:00
Piotr Janosz
562342ac99 Updated terser webpack plugin; Removed uglify plugin (unused). Added parallel option for terser. Added target browsers and cache directory option for babel-loader 2019-08-24 00:05:35 +02:00
Piotr Janosz
14b573ebfd Updated / cleaned up babel and mdx packages 2019-08-24 00:05:35 +02:00
Piotr Janosz
e3834c2fc0 Updated webpack, webpack-dev-server, webpack-bundle-analyzer, webpack-cli versions 2019-08-24 00:05:08 +02:00
Piotr Janosz
c2f3757de7 Fixed some types in guides 2019-08-24 00:05:07 +02:00
Piotr Janosz
4b0010be63 Added longer timeout for algolia admin operations. Added an option to apply hidden and custom labels to filters from algolia. Added sorting guides (alphabetically) and tools (by community maintenance and alphabetically). 2019-08-24 00:05:07 +02:00
Piotr Janosz
078af36e0e Fixed ordered list styles 2019-08-24 00:05:07 +02:00
Chris Kalani
b17d12fe23 Fixed sub headers on CFL guide 2019-08-24 00:05:07 +02:00
Chris Kalani
294c0b449b Added contract-fillable liquidity guide 2019-08-24 00:05:07 +02:00
Chris Kalani
bc3927e973 Added deployed addresses guide 2019-08-24 00:05:07 +02:00
Chris Kalani
a2cfdd2975 Added protocol, coordinator, and forwarder specifications to guides 2019-08-24 00:05:07 +02:00
Piotr Janosz
53b4f48b2e Better way of custom sorting difficulty filters 2019-08-24 00:05:07 +02:00
Piotr Janosz
635b80440a Moved sorting filters to filter group to sort difficulty filters in a custom wat 2019-08-24 00:05:07 +02:00
Piotr Janosz
f2d95477e6 Fixed not all guides / tools showing up on a page 2019-08-24 00:05:07 +02:00
Piotr Janosz
1005e4962a Fixed inline links opening in new tab for external links; fixed scrolling to container if hash is provided 2019-08-24 00:05:07 +02:00
Piotr Janosz
487bc1a08b Added additional props to mdx images 2019-08-24 00:05:07 +02:00
Piotr Janosz
0cf768185e Improved code blocks rendering 2019-08-24 00:05:07 +02:00
Piotr Janosz
b5558a8cff onyl include mdx folder for mdx files parsing 2019-08-24 00:04:47 +02:00
Piotr Janosz
af2b8dfde5 Added webpack chunk name to imported mdx docs. Fixed animation chunk name 2019-08-24 00:04:47 +02:00
Piotr Janosz
2bde5f7034 Fixes bundle analyzer plugin in webpack development 2019-08-24 00:04:47 +02:00
Chris Kalani
c38f913a84 Improved margin on seperator component 2019-08-24 00:04:47 +02:00
Chris Kalani
44b4f91208 TODO: need to fix interan page links before adding specifications 2019-08-24 00:04:47 +02:00
Chris Kalani
9c4ad6ac32 Added Web3 provider guide 2019-08-24 00:04:47 +02:00
Chris Kalani
b151c0b701 Fixed section link in instant guide 2019-08-24 00:04:47 +02:00
Chris Kalani
d4b6db773f Added 0x instant guide 2019-08-24 00:04:47 +02:00
Chris Kalani
7da71c0955 Cleaned up some copy on docs home 2019-08-24 00:04:47 +02:00
Chris Kalani
32adb35c2a Removed community maintained filter on tools page 2019-08-24 00:04:47 +02:00
Chris Kalani
2f197d128a Reduced font size and weight on step links component 2019-08-24 00:04:47 +02:00
fabioberger
5415bc4590 get the indexing script to work without a "stack too deep" error 2019-08-24 00:04:47 +02:00
fabioberger
f6086b8054 Update the MDX files for each tool 2019-08-24 00:04:47 +02:00
fabioberger
c9d77d7fa0 Add 0x.js to tools page 2019-08-24 00:04:47 +02:00
fabioberger
ab8c457c51 Update the Useful Links 2019-08-24 00:04:47 +02:00
fabioberger
5d91ad3656 Add Code Sandbox to tools page 2019-08-24 00:04:47 +02:00
fabioberger
78ffca06ea Add more tools 2019-08-24 00:04:46 +02:00
Piotr Janosz
0d71ec93e7 Fixed a substition blunder 2019-08-24 00:04:46 +02:00
Piotr Janosz
d4c771dc7d Fixed rendereing of docs pages, guides, resource... 2019-08-24 00:04:46 +02:00
Piotr Janosz
68004466bb Fixed search suggestions 2019-08-24 00:04:46 +02:00
fabioberger
4dd2d1afaf Refactor Algolia indexing to also index tools without corresponding mdx files 2019-08-24 00:04:46 +02:00
Piotr Janosz
4947676434 Set index settings and clear it only once 2019-08-24 00:04:46 +02:00
Piotr Janosz
ea5e83da03 Edited the images in core-concepts to be smaller 2019-08-24 00:04:46 +02:00
fabioberger
0705276ff9 Add more tools to docs 2019-08-24 00:04:46 +02:00
Piotr Janosz
0299abf1b5 Added image component that centers images in mdx 2019-08-24 00:04:46 +02:00
Piotr Janosz
132394ffbe snake-case and more accurate filenames for webpack plugins for remark/mdx 2019-08-24 00:04:46 +02:00
Piotr Janosz
40edcef340 Wrapped a comment 2019-08-24 00:04:46 +02:00
Piotr Janosz
bf22eba795 Added a TODO to include api explorer in the search index and autocomplete section titles when the page is ready to be indexed and displayed 2019-08-24 00:04:46 +02:00
Piotr Janosz
e990272db3 Removed custom interfaces by using @0x/types object map 2019-08-24 00:04:46 +02:00
Piotr Janosz
401a0eadb1 Removing dropdown developers as it's not used anymore 2019-08-24 00:04:46 +02:00
Piotr Janosz
5852e0b476 Added clearing index on algolia before pushing objects 2019-08-24 00:04:46 +02:00
Piotr Janosz
401df5f45d Renamed mobileNavs to snake case 2019-08-24 00:04:46 +02:00
fabioberger
7da40fd7bc Increase memory allocation to avoid heap out of memory errors 2019-08-24 00:04:46 +02:00
Piotr Janosz
89740dc24c Changed text / typo 2019-08-24 00:04:46 +02:00
fabioberger
4d7ba42f8f Remove all .DS_Store 2019-08-24 00:04:46 +02:00
fabioberger
bbd9c4ef67 Fix remaining merge issues 2019-08-24 00:04:46 +02:00
Piotr Janosz
de036ae96a Deleted ds store files 2019-08-24 00:03:50 +02:00
Piotr Janosz
e5985d7c3f Added illustrations and animations for core concepts 2019-08-24 00:03:50 +02:00
Piotr Janosz
fb54c45d7d Removed .DS_Store files 2019-08-24 00:03:50 +02:00
Piotr Janosz
f1b704a91a Added bold and italiciezed text example 2019-08-24 00:03:50 +02:00
Piotr Janosz
b99eab6804 Fixed a text example on page template 2019-08-24 00:03:50 +02:00
Piotr Janosz
82acc26f97 Added emphasis italicized text to mdx components 2019-08-24 00:03:50 +02:00
Piotr Janosz
569a165c87 Added keywords to meta for a page and content in algolia 2019-08-24 00:03:49 +02:00
Piotr Janosz
704adcb03d Added description from meta for doc pages 2019-08-24 00:03:49 +02:00
Piotr Janosz
197cdee604 Added updating SEO information on docs pages 2019-08-24 00:03:49 +02:00
Piotr Janosz
3dc5de936e Fixed responsive styles for note callout 2019-08-24 00:03:49 +02:00
Piotr Janosz
d88eb6a5c9 Added a shared folder to docs components. Added (next) step links to mdx 2019-08-24 00:03:49 +02:00
Piotr Janosz
a168f34538 Updated Note to be included in mdx 2019-08-24 00:03:49 +02:00
Piotr Janosz
7b150bab73 Removed newsletter widget from every page, included it in mdx components 2019-08-24 00:03:49 +02:00
Chris Kalani
b0e38f79ea Added legal content, still needs some work 2019-08-24 00:03:49 +02:00
Chris Kalani
a68ebc27ed Added Relayer Strategies guide 2019-08-24 00:03:49 +02:00
Chris Kalani
25705bd314 Disabled horizontal scroll on sidebar nav 2019-08-24 00:03:49 +02:00
Piotr Janosz
85c9b7d9c5 Remove redundant package 2019-08-24 00:03:49 +02:00
Piotr Janosz
629c2ecba2 Added some comments to algolia_index 2019-08-24 00:03:49 +02:00
Piotr Janosz
be0662a41d Updated README to add basic information about indexing the docs 2019-08-24 00:03:49 +02:00
Piotr Janosz
1985fec892 Coreectly setting current version for a doc page in version picker 2019-08-24 00:03:49 +02:00
Piotr Janosz
2cbdd76aa3 Fixed a filter glitch where it would remain disabled after unclicking some other ones 2019-08-24 00:03:49 +02:00
Piotr Janosz
73ae0541d8 Nicer scrollbars for firefox 2019-08-24 00:03:49 +02:00
Piotr Janosz
22621b9f76 Upgraded react helmet 2019-08-24 00:03:49 +02:00
Piotr Janosz
c9f214504a Fixed a lot of types 2019-08-24 00:03:49 +02:00
Piotr Janosz
e8a2d1240f Removed ts-ignore from tools. 2019-08-24 00:03:49 +02:00
Piotr Janosz
f2e0fe49f7 Fixed ts-ignore in animation mdx component 2019-08-24 00:03:49 +02:00
Piotr Janosz
4ce7bf56e7 Put ganache meta with teh other guides 2019-08-24 00:03:49 +02:00
Piotr Janosz
29be232ae9 Updated meta for algolia 2019-08-24 00:03:49 +02:00
Piotr Janosz
794c0342ee Fixed issue with filters not unchecking 2019-08-24 00:03:49 +02:00
Chris Kalani
d5a22829ac Added ganache setup guide 2019-08-24 00:03:49 +02:00
Piotr Janosz
b58d4005d3 Small API explorer title change 2019-08-24 00:03:49 +02:00
Piotr Janosz
c16d9d85a2 Cleaned up inline code component 2019-08-24 00:03:49 +02:00
Piotr Janosz
92aeca1f30 Restored and fixed indexing 2019-08-24 00:03:49 +02:00
Piotr Janosz
b81ed67975 Fixed version picker functionality 2019-08-24 00:03:49 +02:00
Piotr Janosz
2bc6582e6b [WIP] Working on version picker 2019-08-24 00:03:49 +02:00
Piotr Janosz
b27311da2e Added commented out index and suggestion title section for api explorer 2019-08-24 00:03:48 +02:00
Piotr Janosz
ab8a0da16a Added stringifying json prettified on updating algolia meta. Added api explorer to indexes 2019-08-24 00:03:48 +02:00
Piotr Janosz
800e37ed03 Auto-updating aloglia_meta 2019-08-24 00:03:48 +02:00
Piotr Janosz
950e84fe5c [WIP] autogenerating paths + versions for docs. Turned meta for algolia into a json file. 2019-08-24 00:03:48 +02:00
Piotr Janosz
fdbc235fd6 [WIP] new tools 2019-08-24 00:03:48 +02:00
Piotr Janosz
ffdb5c06f6 Removed _test suffix on algolia indices 2019-08-24 00:00:08 +02:00
Piotr Janosz
14f0f89798 Imporved styles for the version picker 2019-08-24 00:00:08 +02:00
Piotr Janosz
54b53184b7 Added a select for docs versions 2019-08-24 00:00:08 +02:00
Piotr Janosz
75b1cdac66 Restored old page + inline code with commented out synatx highlighting 2019-08-24 00:00:08 +02:00
Piotr Janosz
d21f394531 Changes to parsing new docs 2019-08-24 00:00:08 +02:00
Piotr Janosz
86d90599ca Removed unnecessary import 2019-08-24 00:00:08 +02:00
Piotr Janosz
ec24976789 Updated not found page header text color 2019-08-24 00:00:08 +02:00
Piotr Janosz
00eaa8bd34 Removed meta from mdx files 2019-08-24 00:00:08 +02:00
Piotr Janosz
5c44163d68 [WIP] algolia indexing rewrite: cleaned up indexing file 2019-08-24 00:00:08 +02:00
Piotr Janosz
f73bad5c13 [WIP] Rewrite of algolia indexing 2019-08-24 00:00:08 +02:00
Piotr Janosz
a063fa6fe0 Cleaned up nested divs in index.tsx 2019-08-23 23:58:59 +02:00
Piotr Janosz
894ad8af21 Added test content to mdx 2019-08-23 23:58:59 +02:00
Piotr Janosz
c01793599f Fixed react create element error for rendering mdx pages 2019-08-23 23:58:59 +02:00
Piotr Janosz
63db393b60 Adjusted a comment 2019-08-23 23:58:59 +02:00
Piotr Janosz
5846166c85 Changes that fix card links for tools and guides 2019-08-23 23:58:59 +02:00
Piotr Janosz
25e941128a Removed description from algolia snippets and searchable attributes 2019-08-23 23:58:59 +02:00
Piotr Janosz
22964ff913 Blurring input on mouse click 2019-08-23 23:58:59 +02:00
Piotr Janosz
62a58667ba Added scrolling to content if search suggestion links a different section on the page the user is already on 2019-08-23 23:58:59 +02:00
Piotr Janosz
c868015989 Made docs scrollable to section when selecting a link 2019-08-23 23:58:58 +02:00
Piotr Janosz
565e5e5770 Fixed a bug for text nodes not found under a heading. I.e. intro text. 2019-08-23 23:58:58 +02:00
Piotr Janosz
198831d084 Improved algolia indexing: content is now exported with a url hash which can link to a section instead of just the base url 2019-08-23 23:58:58 +02:00
Piotr Janosz
d3be097436 Small cleanup 2019-08-23 23:58:58 +02:00
Piotr Janosz
1259de5be4 Fixed scrolling to top of the window on route change resulting from snippet click / enter 2019-08-23 23:58:58 +02:00
Piotr Janosz
df6be48638 Added code-split animations to mdx 2019-08-23 23:58:58 +02:00
Piotr Janosz
4923fdbb73 Installed react-bodymovin for the new animations 2019-08-23 23:58:58 +02:00
Piotr Janosz
66964a5a2f Added hover transitions to docs home links 2019-08-23 23:58:58 +02:00
Piotr Janosz
97e24d0e14 Added common hover color for background light. Added hover states to other docs home components 2019-08-23 23:58:58 +02:00
Piotr Janosz
fe0b75ef26 Made suggestions / active search input more narrow 2019-08-23 23:58:58 +02:00
Piotr Janosz
4b76efbc28 Added animation to top search bar 2019-08-23 23:58:58 +02:00
Piotr Janosz
11cff4d391 Bluring input on escape key 2019-08-23 23:58:58 +02:00
Piotr Janosz
59211c1c1e Correctly populating input on enter / mouse clicks on suggestions. Bluring input on selecting suggestion (routing away) 2019-08-23 23:58:58 +02:00
Piotr Janosz
c0ab2e8127 D 2019-08-23 23:58:58 +02:00
Piotr Janosz
d39e90bfa1 Changed the way lock body scroll works to not scroll to top when user searches for something 2019-08-23 23:58:58 +02:00
Piotr Janosz
16e55457c8 Moved type definition 2019-08-23 23:58:58 +02:00
Piotr Janosz
ea2a453811 Changed a name of event handler in autocomplete 2019-08-23 23:58:58 +02:00
Piotr Janosz
7d2a768a0c Removed duplicate code for sitewraps 2019-08-23 23:58:58 +02:00
Piotr Janosz
78304c4369 Added matching background gray to footer in docs 2019-08-23 23:58:58 +02:00
Piotr Janosz
85f243e2e0 Added visually disabling filters instead of hiding them by algolia 2019-08-23 23:58:58 +02:00
Piotr Janosz
785ca4f5d1 Added scrolling on overflow of sidebar content in new docs 2019-08-23 23:58:57 +02:00
Piotr Janosz
730e8ad151 Updated react-syntax-highlighter 2019-08-23 23:58:57 +02:00
Piotr Janosz
b3e6e23508 Moved algolia indexing to utils 2019-08-23 23:58:57 +02:00
Piotr Janosz
f09d56cdb9 Removed borders over 900px for autosuggestions 2019-08-23 23:58:57 +02:00
Piotr Janosz
b51933c4d9 Fixed overflow scroll visible on search inputs and developer page in firefox 2019-08-23 23:58:57 +02:00
Piotr Janosz
477791a600 Fixed table overflow visible in firefox 2019-08-23 23:58:57 +02:00
Piotr Janosz
f0d6476f92 Reverted last commit 2019-08-23 23:58:57 +02:00
Piotr Janosz
fa4accd0c4 Increased line height on all paragraph components to 1.5 (better readability IMHO) 2019-08-23 23:58:57 +02:00
Piotr Janosz
e64754f554 Adjusted table borders and hero padding. Added subtitle to core concepts doc 2019-08-23 23:58:57 +02:00
Piotr Janosz
5badb1eb5d Fixed amrgins ob autocomplete highlights 2019-08-23 23:58:57 +02:00
Piotr Janosz
9c52fd1f2a Fixed inactive color ofr table of contents 2019-08-23 23:58:57 +02:00
Piotr Janosz
27e01b9249 Fixed clear filters background 2019-08-23 23:58:57 +02:00
Piotr Janosz
5bf0de5519 Added missing heading sizes to mdx 2019-08-23 23:58:57 +02:00
Piotr Janosz
139a4acb1b Deleted empty file 2019-08-23 23:58:57 +02:00
Piotr Janosz
9d8b2d9e0c Added core concepts to the website, search indexing, and settings 2019-08-23 23:58:57 +02:00
fabioberger
d16a0f1b56 Update yarn.lock 2019-08-23 23:58:57 +02:00
fabioberger
edb63c0f26 Make duration optional 2019-08-23 23:58:57 +02:00
fabioberger
bd3a80bcde Add offset default 2019-08-23 23:58:57 +02:00
fabioberger
9f0da8ec39 Fix remaining react-docs and react-shared issues 2019-08-23 23:58:57 +02:00
Piotr Janosz
42ed4e393f Fixed some mdx issues 2019-08-23 23:58:57 +02:00
Piotr Janosz
99ffe6bb2d Added constants for new docs 2019-08-23 23:58:57 +02:00
Piotr Janosz
70898be894 Added smooth scrolling to react-shared link. Changed docs scroll duration value to 500. Added offset for scrolling / active state to make place for react headroom on scrolling up. 2019-08-23 23:58:56 +02:00
Piotr Janosz
9f1859575d Fixed active color for toc links 2019-08-23 23:58:56 +02:00
Piotr Janosz
0167689374 Added creating distinct id based on file name from mdx instead of having to give each one a custom id 2019-08-23 23:58:56 +02:00
Piotr Janosz
053c5f0f88 Ran yarn 2019-08-23 23:58:56 +02:00
Piotr Janosz
fa6516d0be Added custom plugins for wrapping headings in sections / parsing table of contents based on sections from markdown 2019-08-23 23:58:56 +02:00
Piotr Janosz
7fb0e1b39c Added clear all filters button 2019-08-23 23:58:56 +02:00
Piotr Janosz
8ba439c263 Removed developers dropdown. Renamed developers link to docs 2019-08-23 23:58:56 +02:00
Piotr Janosz
1a1f24146c Styled table of contents links better 2019-08-23 23:58:56 +02:00
Piotr Janosz
086fa31d04 Adjusted the way we import react to match how it's done in the project. 2019-08-23 23:58:56 +02:00
Piotr Janosz
b5e02d1b74 Fixed a bug in index.tsx. Removed remark-headings-normalize 2019-08-23 23:58:56 +02:00
Piotr Janosz
e88aee6ad9 Added not found state for mdx page view 2019-08-23 23:58:26 +02:00
Piotr Janosz
fb4ead84f5 Added remark-normalize-headings to get rid of multiple h1 tags in parsed mdx content 2019-08-23 23:58:26 +02:00
Piotr Janosz
298967e639 Fixed content url parsing for algolia content 2019-08-23 23:58:26 +02:00
Piotr Janosz
903a9947a3 Fixed incorrect formatting by prettier 2019-08-23 23:58:26 +02:00
Piotr Janosz
72beb59d63 Fixed some text in page template 2019-08-23 23:58:26 +02:00
Piotr Janosz
75dd1be40e Added some text to comment 2019-08-23 23:58:26 +02:00
Piotr Janosz
6a7c2918bb Fixed a path bug in algolia indexing; added a yarn script to run docs indexing 2019-08-23 23:58:26 +02:00
Piotr Janosz
9b9ee2415d Further refactoring of algolia indexing 2019-08-23 23:58:26 +02:00
Piotr Janosz
f1f38fb8b0 Further polish of algolia indexing 2019-08-23 23:58:26 +02:00
Piotr Janosz
1e44bcb7c9 Added types to searcg indexing helpers 2019-08-23 23:58:26 +02:00
Piotr Janosz
11e689156e [WIP] added some types for indexing helpers 2019-08-23 23:58:26 +02:00
Piotr Janosz
6c792e89f9 [WIP] porting indexing to typescript, ts-node 2019-08-23 23:58:26 +02:00
Piotr Janosz
11026fe36a Started fixing routes a little bit 2019-08-23 23:58:25 +02:00
Piotr Janosz
3133dde3a3 Created mdx folder for new docs. Moved indexing into the new folder. 2019-08-23 23:58:25 +02:00
Piotr Janosz
b666ca0271 Added packages for aloglia indexing 2019-08-23 23:58:25 +02:00
Piotr Janosz
de5c6c1ed0 Made all search suggestion containers scrollable 2019-08-23 23:58:25 +02:00
Piotr Janosz
34f4cf133b Made header search suggestions scrollable 2019-08-23 23:58:25 +02:00
Piotr Janosz
1ba54af4e2 Added lock body scroll for search in header 2019-08-23 23:58:25 +02:00
Piotr Janosz
42e0d608c8 Added clearing search input in autosuggest on escape key press 2019-08-23 23:58:25 +02:00
Piotr Janosz
2c35d63976 Fixed header for docs (at least temporarily) 2019-08-23 23:58:25 +02:00
Piotr Janosz
d1ca1e768f Finished work on the collapsible sidebar for filters / table of contents in docs 2019-08-23 23:58:25 +02:00
Piotr Janosz
2255cc2ebc [WIP] Added accordion for table of contents / filters. Needs cleanup. 2019-08-23 23:58:25 +02:00
Piotr Janosz
6512c12f40 Refactored fadeIn => fadeInUp animation, removed export 2019-08-23 23:58:25 +02:00
Piotr Janosz
fc8d428d1d Created reusable fadeIn / fadeOut keyframes 2019-08-23 23:58:25 +02:00
Piotr Janosz
e07613818d Refactored docs components structure 2019-08-23 23:58:25 +02:00
Piotr Janosz
de59ae11bd Added website paths for docs 2019-08-23 23:58:25 +02:00
Piotr Janosz
026690c837 Fixed a typo 2019-08-23 23:58:25 +02:00
Piotr Janosz
c223a72f5b Fixed indicator on highlighted snippet 2019-08-23 23:58:25 +02:00
Piotr Janosz
c66cf83ef1 Added types for hits in tools and autocomplete 2019-08-23 23:58:25 +02:00
Piotr Janosz
30cf9ac857 Added rendering featured links in tools 2019-08-23 23:58:25 +02:00
Piotr Janosz
b99b9d5435 [WIP] Added filtered hits by section in tools 2019-08-23 23:58:25 +02:00
Piotr Janosz
81b9ab2b6e Consolidated community links 2019-08-23 23:58:25 +02:00
Piotr Janosz
78a60a9973 Consolidated step links in one file 2019-08-23 23:58:25 +02:00
Piotr Janosz
fca6f838d5 Fixed mobile / tablet padding for newsletter widget 2019-08-23 23:58:25 +02:00
Piotr Janosz
4a39eb7931 Fixed community links opening in a new tab, newsletter widget appearing in mdx view. 2019-08-23 23:58:25 +02:00
Piotr Janosz
00ab5f0afb End of day whitespace fix 2019-08-23 23:58:24 +02:00
Piotr Janosz
34dfd73aab Cleaned up siteWrap for docs and elsewhere. Converted the other sitewrap to function component. 2019-08-23 23:58:24 +02:00
Piotr Janosz
9e0e12a468 Fixed styles for autocomplete wrapper: added indicator for highlighted suggestion 2019-08-23 23:58:24 +02:00
Piotr Janosz
1bdcb4f737 Fixed hamburger menu not appearing at 800px. Laid groundwork for docs header fixes / reusability tomorrow 2019-08-23 23:58:24 +02:00
Piotr Janosz
5e5ecdcf32 [WIP] block body scroll on mobile search 2019-08-23 23:56:40 +02:00
Piotr Janosz
b316217394 Added scroll to top arrow for docs pages 2019-08-23 23:56:40 +02:00
Piotr Janosz
d96e307e2c Updated links for docs home with correct values 2019-08-23 23:56:40 +02:00
Piotr Janosz
a7944bb3c5 Fixed hover styles for step links 2019-08-23 23:56:40 +02:00
Piotr Janosz
2dc3885691 Added min height to section, docs layout 2019-08-23 23:56:40 +02:00
Piotr Janosz
027ab98a3e Adjusted filter margin on mobile / tablet 2019-08-23 23:56:40 +02:00
Piotr Janosz
1a5736a498 [WIP] Filtering for tools upgrades 2019-08-23 23:56:40 +02:00
Piotr Janosz
73f4c036c6 Added algolia constants to configs 2019-08-23 23:56:40 +02:00
Piotr Janosz
6cbadcf8e9 Introduced constant variables for algolia search 2019-08-23 23:56:40 +02:00
Piotr Janosz
6a38f231b1 Extracted content wrapper 2019-08-23 23:56:40 +02:00
Piotr Janosz
02d63daba5 Removed docs page template 2019-08-23 23:56:40 +02:00
Piotr Janosz
99074b3c34 Created reusable columns component 2019-08-23 23:56:18 +02:00
Piotr Janosz
bb33609164 Created a reusable page wrapper for docs pages 2019-08-23 23:56:18 +02:00
Piotr Janosz
27832741e4 Removed 'Loading' paragraph from icon loading state 2019-08-23 23:56:18 +02:00
Piotr Janosz
0cffdc9868 Fixed community maintained filter (custom label prop for filters). Fixed tools content display [WIP]. 2019-08-23 23:56:18 +02:00
Piotr Janosz
6055d44120 Fixed topics filter for guides 2019-08-23 23:56:18 +02:00
Piotr Janosz
984305d483 Small cleanup for docs 2019-08-23 23:56:18 +02:00
Piotr Janosz
7934624afc Connected guides to algolia 2019-08-23 23:56:18 +02:00
Piotr Janosz
e7db5aa4f3 Fixed filters, connected to algolia 2019-08-23 23:56:18 +02:00
Piotr Janosz
e922299a55 Added ellipsis to search placeholders 2019-08-23 23:56:18 +02:00
Piotr Janosz
58cbc7a05f Added helpful comments, removed Formular Mono from inputs 2019-08-23 23:56:18 +02:00
Piotr Janosz
43648a2382 Changed algolia creds 2019-08-23 23:56:18 +02:00
Piotr Janosz
c1abaa3293 Small cleanup of autocomplete component 2019-08-23 23:56:18 +02:00
Piotr Janosz
9f77879198 Added current refinement to wrapper props to get the correct zindex value for header search over docs search 2019-08-23 23:56:18 +02:00
Piotr Janosz
79279e5614 [WIP] Fixed reusable zIndex values. Added overlay for search in docs. 2019-08-23 23:56:18 +02:00
Piotr Janosz
d100897b20 Finished responsive styling for search input / autosuggest 2019-08-23 23:56:18 +02:00
Piotr Janosz
bfaaefaf0a Fixed font size and appearance of logo / docs for docs header 2019-08-23 23:56:17 +02:00
Piotr Janosz
520c6fa426 Hide section titles in autosuggest if returned hits are an empty list 2019-08-23 23:56:17 +02:00
Piotr Janosz
d95b520512 Added link tag to search suggestions 2019-08-23 23:56:17 +02:00
Piotr Janosz
10f8637802 Styling for search input home 2019-08-23 23:56:17 +02:00
Piotr Janosz
b327cc0f52 Fixed responsive bugs for docs page and template 2019-08-23 23:56:17 +02:00
Piotr Janosz
88acdaff90 Using the reusable Link component from react-shared for components with links in docs 2019-08-23 23:56:17 +02:00
Piotr Janosz
d5039809de Styled whitespace for docs pages 2019-08-23 23:56:17 +02:00
Piotr Janosz
2746b73416 Styled guides for responsive breakpoints 2019-08-23 23:56:17 +02:00
Piotr Janosz
fdd1d20c5b Using reusable Link for feature link. Added responsive styles for it. 2019-08-23 23:56:17 +02:00
Piotr Janosz
e2b4670016 Refactored some stuff 2019-08-23 23:56:17 +02:00
Piotr Janosz
336adc6974 Styled resource for different screen widths 2019-08-23 23:56:17 +02:00
Piotr Janosz
7c72ac52e1 Removed unnecessary wrapper 2019-08-23 23:56:17 +02:00
Piotr Janosz
d165bb2bb2 [WIP] styling search components 2019-08-23 23:56:17 +02:00
Piotr Janosz
12dea02fab Fixed styles for desktop snippet highlightig in autocomplete 2019-08-23 23:56:17 +02:00
Piotr Janosz
5181ee172b Fixed font weights for search input 2019-08-23 23:56:17 +02:00
Piotr Janosz
def0d9307e [WIP] Styling search: font weight for titles 2019-08-23 23:56:17 +02:00
Piotr Janosz
45e572388b [WIP] Tweak search: removed unnecessary code 2019-08-23 23:56:17 +02:00
Piotr Janosz
4898de8d41 [WIP] Tweaking search visually and logically 2019-08-23 23:56:17 +02:00
Piotr Janosz
1aa2270d97 [WIP styling mobile nav menu for docs] 2019-08-23 23:56:17 +02:00
Piotr Janosz
5abc9a8066 Using the reusable Link from react-shared for mobile nav menu 2019-08-23 23:56:17 +02:00
Piotr Janosz
a8deb6cc74 [WIP] Refactoring mobileNav to support docs 2019-08-23 23:56:17 +02:00
Piotr Janosz
87bcb46f43 [WIP] Refactored original header in anticipation for changes to docs header 2019-08-23 23:55:20 +02:00
Piotr Janosz
3d904aac67 Made separator margin for mobile a prop 2019-08-23 23:55:20 +02:00
Piotr Janosz
ace63fe83a Fixed docs whitespace for mobile / tablet 2019-08-23 23:55:20 +02:00
Piotr Janosz
33320fd758 Extracted get started links from home 2019-08-23 23:55:20 +02:00
Piotr Janosz
be5b4b7702 Fixed footer link wrapper margin on tablet 2019-08-23 23:55:20 +02:00
Piotr Janosz
5c55064c0f Refactored footer a tiny bit to fix styles on tablet + use es6 instead of lodash 2019-08-23 23:55:20 +02:00
Piotr Janosz
71ad8dcec0 Extracted a common Spearator (hr) component to reuse in docs. Adjusted styling for toc on mobile and tablet 2019-08-23 23:55:20 +02:00
Piotr Janosz
09fd8bc521 [WIP] Added overflow prop to section new layout. Fixed mobile layout for docs page. 2019-08-23 23:55:20 +02:00
Piotr Janosz
ace0150fcb Cleanup for table of contents. Added containerId default prop to link in react-shared 2019-08-23 23:55:20 +02:00
Piotr Janosz
e627d3ce01 [WIP] table of contents adjustments 2019-08-23 23:55:20 +02:00
Piotr Janosz
a65f981f55 Styled react-scroll links in table of contents 2019-08-23 23:55:20 +02:00
Piotr Janosz
dbebb3818d [WIP] responsive tweaks to docs page template 2019-08-23 23:55:20 +02:00
Piotr Janosz
2027b74c5f Added a boolean isCommunity flag to resource to simplify adding labels 2019-08-23 23:55:20 +02:00
Piotr Janosz
5e921fdd08 Fixed styles for community maintained tag 2019-08-23 23:55:20 +02:00
Piotr Janosz
6eda017719 Fixed heading size for other pages than home in docs 2019-08-23 23:55:20 +02:00
Piotr Janosz
9b9960c7b9 Extracted mdx-mapped headings to a separate file. Applied correct sizing to headings 2019-08-23 23:55:20 +02:00
Piotr Janosz
9df09e2464 Added min-width to notification icon 2019-08-23 23:55:20 +02:00
Piotr Janosz
5dacc58a4e Renamed tutorial steps => ordered list (to match other component names) 2019-08-23 23:55:20 +02:00
Piotr Janosz
fcb18e8d34 Fixed line height for lists in docs 2019-08-23 23:55:20 +02:00
Piotr Janosz
9af95a9461 Fixed line-height for notifications (mobile) 2019-08-23 23:55:20 +02:00
Piotr Janosz
bef662a6e1 Restored analytics for was_this_helpful 2019-08-23 23:55:20 +02:00
Piotr Janosz
04f24f32e2 Added responsive styles for helpful cta 2019-08-23 23:55:20 +02:00
Piotr Janosz
65743882bb Updated styles for unordered list 2019-08-23 23:55:20 +02:00
Piotr Janosz
9e82b51eb5 Created two demo pages to test the components 2019-08-23 23:55:20 +02:00
Piotr Janosz
a20c40ca90 Further responsive styling of docs home 2019-08-23 23:55:20 +02:00
Piotr Janosz
745bdda1a3 Adjusted icon sizes 2019-08-23 23:55:20 +02:00
Piotr Janosz
3c7e538202 Fixed styles for community links 2019-08-23 23:55:20 +02:00
Piotr Janosz
786419fee0 Fixed responsive styles for docs home: shortcut links 2019-08-23 23:55:20 +02:00
Piotr Janosz
739651b917 Changed loader thickness for docs 2019-08-23 23:55:20 +02:00
Piotr Janosz
e374469818 [WIP] restyling search input in the header 2019-08-23 23:55:20 +02:00
Piotr Janosz
2ecd9672c2 Refactored autocomplete into a function component 2019-08-23 23:55:20 +02:00
Piotr Janosz
68a4ad2e51 Restyled search autocomplete 2019-08-23 23:55:20 +02:00
Piotr Janosz
b2e2c27775 Updated ToC / usage doc 2019-08-23 23:55:20 +02:00
Piotr Janosz
8e45d5e137 [WIP] Created table of contents 2019-08-23 23:55:19 +02:00
Piotr Janosz
1ded7cd4f1 Figured out how to export ToC via mdx-loader 2019-08-23 23:55:19 +02:00
Piotr Janosz
8bd2411a89 Fixed icon color for help callout 2019-08-23 23:55:19 +02:00
Piotr Janosz
907fba7d0f Hooked up analytics to helpful cta 2019-08-23 23:55:19 +02:00
Piotr Janosz
bb5afc43b9 Added state to helpful_cta 2019-08-23 23:55:19 +02:00
Piotr Janosz
a243c9d685 Fixed styling for help callout 2019-08-23 23:55:19 +02:00
Piotr Janosz
829eeb2374 Refactored unnecessary Hero props 2019-08-23 23:55:19 +02:00
Piotr Janosz
338de4ffa1 Fixed colors for resource tags 2019-08-23 23:55:19 +02:00
Piotr Janosz
c7fbd6c64c Added temp mapping content to section in tools 2019-08-23 23:55:19 +02:00
Piotr Janosz
95b7ae3146 Fixed rendering tools page 2019-08-23 23:55:19 +02:00
Piotr Janosz
ded48fd453 Updated docs homepage icons 2019-08-23 23:55:19 +02:00
Piotr Janosz
cbe2cf8a85 Updated styling for the loader in mdx docs 2019-08-23 23:55:19 +02:00
Piotr Janosz
a12dc5c81b [WIP] Updated react-syntax-highlighter. Added loading state to docs. Replaced search placeholder text. 2019-08-23 23:55:19 +02:00
Piotr Janosz
db062154d1 Changed tabs => code_tabs. Changed notification signature. Removed old unused code (docs view duplicate) 2019-08-23 23:55:19 +02:00
Piotr Janosz
ac3a6426e8 Correctly parsing tabbed code snippets from mdx 2019-08-23 23:55:19 +02:00
Piotr Janosz
f1f5b57254 [WIP] Refactoring complex code components 2019-08-23 23:55:19 +02:00
Piotr Janosz
3403e8af9b Added inline code / link to mapped mdx components. Changed font size for search input in docs. 2019-08-23 23:55:19 +02:00
Piotr Janosz
19286db952 Parsing language passed in to code in mdx. Renamed boolean prop run => canRun 2019-08-23 23:55:19 +02:00
Piotr Janosz
40234e5b4a Fixed styling for copy / run code buttons in code snippet 2019-08-23 23:55:19 +02:00
Piotr Janosz
a9f046609c Removed some whitespace 2019-08-23 23:55:19 +02:00
Piotr Janosz
f2e2672e81 Renamed coreConcepts icon. Restyled how copy button and tabs appear in code 2019-08-23 23:55:19 +02:00
Piotr Janosz
784f2674a9 Updated icons for docs 2019-08-23 23:55:19 +02:00
Piotr Janosz
93399165e7 Updated some icons. Fixed styling for Code [WIP] 2019-08-23 23:55:19 +02:00
Piotr Janosz
7422485817 [WIP] new docs icons. Some need replacement as they render badly 2019-08-23 23:55:19 +02:00
Piotr Janosz
2ef19f31db [WIP] Async docs page loading 2019-08-23 23:53:44 +02:00
Piotr Janosz
8154209eab [WIP] docs view 2019-08-23 23:53:44 +02:00
Piotr Janosz
d56fb374a7 Created a reusable newsletter signup form and widget 2019-08-23 23:53:44 +02:00
Piotr Janosz
7bad1d2921 Refactored newsletter form into a stateless component 2019-08-23 23:53:44 +02:00
Piotr Janosz
37dd494abd Changed global form style for inputs to Formular 2019-08-23 23:53:44 +02:00
Piotr Janosz
a9748e1b52 [WIP] started working on the newsletter signups 2019-08-23 23:53:44 +02:00
Piotr Janosz
cc33101923 Fixed note styling 2019-08-23 23:53:43 +02:00
Piotr Janosz
31fbbb52a8 Small refactoring imporvements to docs components 2019-08-23 23:53:43 +02:00
Piotr Janosz
d2c5665a30 Refactored autocomplete, chapter links, filter, filters. 2019-08-23 23:53:43 +02:00
Piotr Janosz
06744ee7fb Refactored resource and tag components 2019-08-23 23:53:43 +02:00
Piotr Janosz
3e1db453ff Refactored rating_bar 2019-08-23 23:53:43 +02:00
Piotr Janosz
ec76186c23 Removed suprflous code from table, tutorial steps, unordered list 2019-08-23 23:53:43 +02:00
Piotr Janosz
fcf975a65c Refactored tutorial_steps. 2019-08-23 23:53:43 +02:00
Piotr Janosz
e6d2c7db88 Refactored Table components 2019-08-23 23:53:43 +02:00
Piotr Janosz
d012268953 Fixed small errors 2019-08-23 23:53:43 +02:00
Piotr Janosz
70b797cb6d Refactored siteWrap into a function component 2019-08-23 23:53:43 +02:00
Piotr Janosz
28d7cf38c8 Small refactoring of search input 2019-08-23 23:53:43 +02:00
Piotr Janosz
6094fa7b6d Changed import order in docs home. 2019-08-23 23:53:43 +02:00
Piotr Janosz
8f3b7ee522 Refactored search_input and shortcut_link components 2019-08-23 23:53:43 +02:00
Piotr Janosz
74f6fb7408 Refactored Note / Notification components 2019-08-23 23:53:43 +02:00
Piotr Janosz
4ccb735282 Cleaned up helpful_cta, hero, newsletter_signup components. 2019-08-23 23:53:43 +02:00
Piotr Janosz
b94631c84a Refactored help callout 2019-08-23 23:53:43 +02:00
Piotr Janosz
2544e4fd65 Fixed margin forget started buttons in docs home 2019-08-23 23:53:43 +02:00
Piotr Janosz
7454a7a6f3 [WIP] Refactoring of docs pages components. 2019-08-23 23:53:43 +02:00
Piotr Janosz
13e262b9cf [WIP] refactoring docs header 2019-08-23 23:53:43 +02:00
Piotr Janosz
b4db9d8b7d Refactored community and feature links 2019-08-23 23:53:43 +02:00
Piotr Janosz
14ad5ced78 Refactored community link props 2019-08-23 23:53:43 +02:00
Piotr Janosz
b2e592bb41 Refactored docs home 2019-08-23 23:53:43 +02:00
Piotr Janosz
1a3281a959 Refactored and renamed callout => notificatin 2019-08-23 23:53:43 +02:00
Piotr Janosz
6701c58a10 Refactored runnable code snippet 2019-08-23 23:53:43 +02:00
Piotr Janosz
80fd0db2eb (WIP) refactoring code tabs, adding runnable code. 2019-08-23 23:53:43 +02:00
Piotr Janosz
7ca8c5c16d Cleaned up code and tabs components in docs 2019-08-23 23:53:43 +02:00
Fred Carlsen
3ed7cc5cab Added more components to MDX render 2019-08-23 23:53:43 +02:00
Fred Carlsen
0987ae05a8 Update page template 2019-08-23 23:53:43 +02:00
Fred Carlsen
3154149d37 Import more custom components to MDX 2019-08-23 23:53:43 +02:00
Fred Carlsen
6f46109617 Fit code to MDX 2019-08-23 23:53:42 +02:00
Fred Carlsen
b0896408d2 Add discord link 2019-08-23 23:53:42 +02:00
Fred Carlsen
243b478b99 Cleanup 2019-08-23 23:53:42 +02:00
Fred Carlsen
fabbad2b2c Tweak view to export metadata as object from mdx 2019-08-23 23:53:42 +02:00
Piotr Janosz
1948ffe7bd Updated and saved react / react-dom versions to 16.8.6 2019-08-23 23:53:42 +02:00
Fred Carlsen
67baee60f8 MDX module declaration 2019-08-23 23:53:42 +02:00
Fred Carlsen
8f4c4715e2 Improve loading 2019-08-23 23:53:42 +02:00
Fred Carlsen
3e7cbe6015 Fix link on docs template example 2019-08-23 23:53:42 +02:00
Fred Carlsen
0053bde668 Fix react dependencies across all packages 2019-08-23 23:53:42 +02:00
Fred Carlsen
363dd31768 Ignore custom SSL certs 2019-08-23 23:53:42 +02:00
Fred Carlsen
f841737adc Add MDX provider 2019-08-23 23:53:42 +02:00
Fred Carlsen
9adaa7972e Add view template + mdx example 2019-08-23 23:53:42 +02:00
Piotr Janosz
ec387f9bb7 Added node version manager config file to gitignore 2019-08-23 23:53:42 +02:00
Fred Carlsen
aa657776fc Tweak tools page 2019-08-23 23:53:42 +02:00
Fred Carlsen
f12632a1f2 Tweak search 2019-08-23 23:53:42 +02:00
Fred Carlsen
4f8164dc43 Pass filter groups as props 2019-08-23 23:53:42 +02:00
Fred Carlsen
88303d8855 Cleanup 2019-08-23 23:53:42 +02:00
Fred Carlsen
4e8ddafa64 Upgrade react to 16.8 2019-08-23 23:53:42 +02:00
Fred Carlsen
1ebe9d2bba Add prettier 2019-08-23 23:53:25 +02:00
Fred Carlsen
fbae619725 Add key 2019-08-23 23:53:25 +02:00
Fred Carlsen
8c5f4c3de7 WIP search 2019-08-23 23:53:25 +02:00
Fred Carlsen
154841157f Add chapter links 2019-08-23 23:53:04 +02:00
Fred Carlsen
6a20d06194 Add get started link 2019-08-23 23:53:04 +02:00
Fred Carlsen
245e118016 Fix search box icon 2019-08-23 23:53:04 +02:00
Fred Carlsen
fcc9d6749c Add tools page 2019-08-23 23:53:04 +02:00
Fred Carlsen
9e091c5015 Format code 2019-08-23 23:52:46 +02:00
Fred Carlsen
01247319c3 Prettier 2019-08-23 23:52:46 +02:00
Fred Carlsen
1d3d5f7e32 WIP guides page 2019-08-23 23:52:46 +02:00
Fred Carlsen
49f2cef5ac WIP components 2019-08-23 23:52:45 +02:00
Fred Carlsen
926d165321 More WIP components 2019-08-23 23:52:45 +02:00
Fred Carlsen
86218445cd Fix dependencies 2019-08-23 23:52:45 +02:00
Matthew Cadier Kim
6e0f695699 Remove pipeline package
* Remove entire readme for the pipelines package.

* remove pipeline everywhere

* bump circle ci
2019-08-23 23:52:32 +02:00
Xianny
7b9ff7776d Prune fields from EthBalanceChecker (#1876)
Remove forbidden fields from EthBalanceChecker
2019-08-23 23:52:32 +02:00
Fabio Berger
e0f3f53d42 Update Python artifact 2019-08-23 23:52:32 +02:00
Fabio Berger
2e911ee709 Add artifact to Python package 2019-08-23 23:52:32 +02:00
Fred Carlsen
43afed6654 Add mdx loader 2019-08-23 23:52:32 +02:00
Fred Carlsen
0dda8328af Use custom cert if server.key/.crt file exits in website dir 2019-08-23 23:52:31 +02:00
Fred Carlsen
48052fc3e4 WIP docs 2019-08-23 23:52:31 +02:00
Fred Carlsen
5ac5fed513 Prefix methods 2019-08-23 23:51:38 +02:00
Fred Carlsen
60521e8167 Prefix methods 2019-08-23 23:51:38 +02:00
Fred Carlsen
510568d4f1 Change to hash for triggering contact modals 2019-08-23 23:51:37 +02:00
Fred Carlsen
3e3ec3134d Added close button to contact modal 2019-08-23 23:51:37 +02:00
Fred Carlsen
c22374893e Remove unused vars 2019-08-23 23:51:37 +02:00
Fred Carlsen
013eaeeb07 Fix svg errors 2019-08-23 23:51:37 +02:00
Fred Carlsen
b97b6867d8 Add modal links 2019-08-23 23:51:37 +02:00
fabioberger
87f31ec532 Update yarn.lock 2019-08-23 23:38:41 +02:00
fabioberger
9b12695443 Fix rebase issue 2019-08-23 23:34:04 +02:00
Xianny
cbb40c1c2b Remove generated wrappers from contract-wrappers (#2086) 2019-08-23 10:22:50 -07:00
fabioberger
b0e56fc27b Bump version of ts-doc-gen 2019-08-23 19:13:27 +02:00
fabioberger
d15532227d Update yarn.lock 2019-08-23 19:12:04 +02:00
fabioberger
c3f98e95ad Remove 0x.js from packages getting MD docs generated for them 2019-08-23 19:12:04 +02:00
fabioberger
e92e99d6ea Add missing devDep 2019-08-23 19:12:04 +02:00
fabioberger
f6b67f6c98 Remove absolute paths from docs 2019-08-23 19:11:16 +02:00
fabioberger
108861b6ca Update ts-doc-gen to version that removes absolute paths from docs 2019-08-23 19:11:16 +02:00
fabioberger
80d93e8d75 Output reference docs with mdx file extension 2019-08-23 19:10:29 +02:00
fabioberger
1634cd53be Update ts-doc-gen dep 2019-08-23 19:10:29 +02:00
fabioberger
577df3749d Remove temporary artifact 2019-08-23 19:08:30 +02:00
fabioberger
73c53b3da6 Use .mdx extension for packages 2019-08-23 19:08:30 +02:00
fabioberger
9af996a907 Upgrade circleCI yarn 2019-08-23 19:08:30 +02:00
fabioberger
bd2e4a8076 Store contract-wrappers node_modules as artifacts 2019-08-23 19:08:30 +02:00
fabioberger
ceaa6a592c Update ts-doc-gen 2019-08-23 19:07:17 +02:00
fabioberger
b503fecccb Add ignore compiler errors in Typedoc json command for now 2019-08-23 19:06:40 +02:00
fabioberger
4161055cc7 Remove all localhost resolutions from yarn 2019-08-23 19:06:20 +02:00
fabioberger
b0c9a3bbe1 Remove excess comma 2019-08-23 19:06:19 +02:00
fabioberger
436bdde461 Temporarily ignore compiler errors since Typedoc is using Typescript 3.5.x and we are still on 3.0.1 but upgrading should happen in a separate PR 2019-08-23 19:06:19 +02:00
fabioberger
01853064b0 Fix ts-doc-gen version to 0.0.7 2019-08-23 19:06:19 +02:00
fabioberger
c1ccb5af0f Update Typedoc version 2019-08-23 19:05:38 +02:00
fabioberger
706f04ee27 Remove forced resolution of graceful-fs since new Lerna version depends on backward incompatible behavior to pinned version 2019-08-23 19:05:38 +02:00
fabioberger
549e35e972 Update yarn.lock 2019-08-23 19:05:38 +02:00
fabioberger
1ed66966a8 Prettierignore generated docs 2019-08-23 19:05:38 +02:00
fabioberger
326539f1f5 Update ts-docs-gen dep and re-generate the reference docs 2019-08-23 19:05:38 +02:00
fabioberger
67322ba39f Only upload MD docs if an actual publish 2019-08-23 19:04:36 +02:00
fabioberger
41fcc41bd1 Fix linter 2019-08-23 19:04:36 +02:00
fabioberger
7aacff62ca Add MD doc generation and S3 upload to publishing flow 2019-08-23 19:04:36 +02:00
fabioberger
4566ddb037 Split MD doc generation and S3 uploading 2019-08-23 19:04:36 +02:00
fabioberger
957e6b1500 Add Doc MD generation & S3 upload commands and generate the MD docs for the current version 2019-08-23 19:04:36 +02:00
fabioberger
5945635d1d Remove doc commands from sol-tracing-utils because we don't gen docs for this package 2019-08-23 19:01:16 +02:00
F. Eugene Aumson
045fc0914b abi-gen: inline @0x/abi-gen-templates (#2082)
* abi-gen: inline @0x/abi-gen-templates

And use those inlines by default, relieving caller of having to specify
--template and --partials all the time.

Simplify abi-gen usage in all package.json's, omitting --template and
--partials to defer to the defaults.

* abi-gen: Update CHANGELOG.json

* contract_wrappers.py: be a user of abi-gen
2019-08-22 12:23:15 -04:00
Jacob Evans
72442871aa Remove accidental env 2019-08-22 18:45:20 +10:00
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
Fabio Berger
e853555165 Publish
- 0x.js@6.0.10
 - @0x/abi-gen@2.1.0
 - @0x/abi-gen-templates@2.2.1
 - @0x/abi-gen-wrappers@5.0.0
 - @0x/assert@2.1.0
 - @0x/asset-buyer@6.1.6
 - @0x/asset-swapper@0.0.2
 - @0x/base-contract@5.1.1
 - @0x/connect@5.0.11
 - @0x/contract-addresses@3.0.0
 - @0x/contract-artifacts@2.0.1
 - @0x/contract-wrappers@9.1.5
 - @0x/contracts-gen@1.0.10
 - @0x/dev-tools-pages@0.0.28
 - @0x/dev-utils@2.2.4
 - ethereum-types@2.1.3
 - @0x/fill-scenarios@3.0.11
 - @0x/instant@1.0.25
 - @0x/json-schemas@3.0.11
 - @0x/metacoin@0.0.52
 - @0x/migrations@4.1.7
 - @0x/monorepo-scripts@1.0.33
 - @0x/order-utils@8.2.0
 - @0x/order-watcher@4.0.12
 - @0x/python-contract-wrappers@1.0.1
 - @0x/react-docs@2.0.13
 - @0x/react-shared@2.0.13
 - @0x/sol-compiler@3.1.9
 - @0x/sol-coverage@3.0.6
 - @0x/sol-doc@2.0.13
 - @0x/sol-profiler@3.1.8
 - @0x/sol-resolver@2.0.8
 - @0x/sol-trace@2.0.14
 - @0x/sol-tracing-utils@6.0.13
 - @0x/sra-spec@2.0.11
 - @0x/subproviders@4.1.1
 - @0x/testnet-faucets@1.0.81
 - @0x/types@2.4.0
 - @0x/typescript-typings@4.2.3
 - @0x/utils@4.4.0
 - @0x/web3-wrapper@6.0.7
 - @0x/website@0.0.84
 - @0x/contracts-asset-proxy@2.2.0
 - @0x/contracts-coordinator@2.0.5
 - @0x/contracts-dev-utils@0.0.2
 - @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-forwarder@3.0.4
 - @0x/contracts-exchange-libs@3.0.0
 - @0x/contracts-extensions@4.0.0
 - @0x/contracts-multisig@3.1.6
 - @0x/contracts-test-utils@3.1.8
 - @0x/contracts-utils@3.1.7
2019-07-13 01:33:08 -07:00
Fabio Berger
2ce09d73ac Updated CHANGELOGS 2019-07-13 01:32:53 -07:00
Fabio B
14f48a5f4f Merge pull request #1952 from 0xProject/fix/redeployed-2.0-mainnet
Redeployed 2.0 Mainnet
2019-07-13 09:45:59 +02:00
Jacob Evans
8da4e4a830 Redployed 2.0 Mainnet 2019-07-13 16:57:13 +10:00
Xianny
88ae8311c8 Copy dutch auction asset data utils to @0x/order-utils (#1943)
* copy dutch auction assetdata utils to @0x/order-utils

* encode/decode dutch auction asset data using order-utils
2019-07-12 17:27:06 -07:00
David Sun
eabf6a466a Fix abi-gen-wrappers dependencies 2019-07-12 16:35:50 -07:00
David Sun
989f691d06 updated dependencies versioning in package.json 2019-07-12 16:13:05 -07:00
David Sun
52a3dae7cb Merge pull request #1950 from 0xProject/feature/CFL/light-refactor
Asset-swapper method interface change
2019-07-12 15:44:41 -07:00
David Sun
8a6dfacf71 inverted erc and assetdata getSwapQuote naming 2019-07-12 15:30:25 -07:00
Xianny
19ca6c13ad Copy validation methods from ExchangeWrapper to order-utils (#1937) 2019-07-12 15:06:32 -07:00
Fabio Berger
9196f122dd Fix 0x.js version 2019-07-12 14:51:14 -07:00
David Sun
55e3d81c58 updating CHANGELOG.json + package.json 2019-07-12 14:38:19 -07:00
David Sun
80caa16718 Merge pull request #1949 from 0xProject/feature/fix-monorepo-scripts
Fix case in pre-publish write access checks
2019-07-12 14:00:35 -07:00
David Sun
ddc5aaacdb Update condition for readability
Co-Authored-By: Fabio B <me@fabioberger.com>
2019-07-12 13:39:41 -07:00
David Sun
38825865cc prettier 2019-07-12 13:32:27 -07:00
David Sun
157b2efa1d fix to not throw on new packages 2019-07-12 13:16:00 -07:00
F. Eugene Aumson
212a2d229a This one weird trick cuts contract test runtime by over 50% in CI (#1941)
* CI: Collapse each test task to a single wsrun call

* Restore test-rest to invoking wsrun many times
2019-07-12 14:11:53 -04:00
Xianny
ccb89fb26a prettify generated code for easier diffing (#1944) 2019-07-11 16:03:14 -07:00
David Sun
3a0b0c0973 Merge pull request #1939 from 0xProject/CFL
Asset-swapper 0.0.1 merge
2019-07-11 15:42:15 -07:00
David Sun
c159ed9ebb updated changelog 2019-07-11 15:16:45 -07:00
David Sun
e37dbcc273 updated package.json 2019-07-11 15:16:45 -07:00
David Sun
841e660b1f light fixes 2019-07-11 15:16:45 -07:00
David Sun
391aba5f37 updated CHANGELOG.json 2019-07-11 15:16:40 -07:00
David Sun
f5d30f4a07 Update packages/asset-buyer/src/swap_quoter.ts
Co-Authored-By: Jacob Evans <jacob@dekz.net>
2019-07-11 15:15:30 -07:00
David Sun
230cf7dfb7 Update packages/asset-buyer/src/swap_quoter.ts
Co-Authored-By: Jacob Evans <jacob@dekz.net>
2019-07-11 15:15:30 -07:00
David Sun
8734b70f83 updated README.md 2019-07-11 15:15:09 -07:00
David Sun
ff9a2b2d9a fixed docs issues 2019-07-11 15:15:09 -07:00
David Sun
a41dab2922 Commit coverage directory 2019-07-11 15:15:09 -07:00
David Sun
f4504106a1 adding back asset-buyer for legacy support 2019-07-11 15:15:09 -07:00
David Sun
1a5b8041c7 renamed to asset-swapper 2019-07-11 15:15:09 -07:00
David Sun
1e2170f8bb reverting change to abi-gen 2019-07-11 15:15:09 -07:00
David Sun
0a4a973a7f changes to types for doc generation 2019-07-11 15:15:09 -07:00
David Sun
67137cadac made get Consumer private 2019-07-11 15:15:09 -07:00
David Sun
ead4afa06b fixed linting issues 2019-07-11 15:15:09 -07:00
David Sun
e39ef95191 fixed build issues 2019-07-11 15:15:09 -07:00
David Sun
3d7585671f refactored 2019-07-11 15:15:09 -07:00
David Sun
44806106db prettier 2019-07-11 15:15:09 -07:00
David Sun
6a8197a4e8 linting issues 2019-07-11 15:15:09 -07:00
David Sun
4d4b4e0f2b lint + prettier 2019-07-11 15:15:09 -07:00
David Sun
82da33d742 light refactor 2019-07-11 15:15:09 -07:00
David Sun
1c6130a492 fixed market utils 2019-07-11 15:15:09 -07:00
David Sun
dabe5e939f fixed bugs 2019-07-11 15:15:09 -07:00
David Sun
b4ac6d3439 refactored types and market sell operation 2019-07-11 15:15:09 -07:00
David Sun
d0ea74e180 fixed linting issues 2019-07-11 15:15:08 -07:00
David Sun
a5f77f3964 prettier 2019-07-11 15:15:08 -07:00
David Sun
9401bb53e8 added testing for generating swap quotes 2019-07-11 15:15:08 -07:00
David Sun
347c6d02cf upgraded exchange sell with market sell 2019-07-11 15:15:08 -07:00
David Sun
64a0080616 add forwarder logic for market sell 2019-07-11 15:15:08 -07:00
David Sun
288a7d4cea refactored for market sell + buy 2019-07-11 15:15:08 -07:00
David Sun
1207b68f57 added market-sell logic 2019-07-11 15:15:08 -07:00
David Sun
2b82187fe0 expanded swap quoter to create market sell swap quotes 2019-07-11 15:15:08 -07:00
David Sun
3e2dbfc83c added testing to market utils for market sell 2019-07-11 15:15:08 -07:00
David Sun
6691f490bc changes to order utils 2019-07-11 15:15:08 -07:00
David Sun
a7db900e51 added types 2019-07-11 15:15:08 -07:00
David Sun
cfa2a90dae prettier 2019-07-11 15:15:08 -07:00
David Sun
feebb45e9d fixed linting issues 2019-07-11 15:15:08 -07:00
David Sun
13a2f3a330 updated to async 2019-07-11 15:15:08 -07:00
David Sun
1da8801084 switched from arrow functions 2019-07-11 15:15:08 -07:00
David Sun
7a7b17c4f3 fixed naming of utils 2019-07-11 15:15:08 -07:00
David Sun
2afb06de13 refactored forwarder to utilize utils 2019-07-11 15:15:08 -07:00
David Sun
ac771e2865 finished exchange swap quote consumer 2019-07-11 15:15:08 -07:00
David Sun
4b09204936 framework for exchange swap quote consumer 2019-07-11 15:15:08 -07:00
David Sun
e4a5518a7c refactored exchange swap quote consumer 2019-07-11 15:15:08 -07:00
David Sun
e83507ba98 added structure of exchange consumer 2019-07-11 15:15:08 -07:00
David Sun
6e5b77edb2 initial commit of exchange_swap_quote consumer 2019-07-11 15:15:08 -07:00
David Sun
98167da8fa fixing build issues
fixed build issues

prettier
2019-07-11 15:15:08 -07:00
David Sun
11d5fec59b changes on affiliate fee and other changes
bumped version to 7 and added changelog

updated package.json

revert change to package.json

trying this package.json config
2019-07-11 15:15:08 -07:00
David Sun
ed02f4ca88 switching consumer functions to async 2019-07-11 15:15:08 -07:00
David Sun
e7c612971d fixed percentage assertions 2019-07-11 15:15:08 -07:00
David Sun
242a2e21b5 updated comments
added comments to Forwarder Swap Quote Conusmer
2019-07-11 15:15:08 -07:00
David Sun
92a1e5413b change to affiliate fees 2019-07-11 15:15:08 -07:00
David Sun
e1ab9aa690 rewritten test cases for SwapQuoter
fixed testing for swap quoter + setup for consumer testing

added framework for testing consumers

added testing and updated some types
2019-07-11 15:15:08 -07:00
David Sun
222f7e6fd4 addressed reviews and light refactor
added comments to types and refactored some naming
2019-07-11 15:15:08 -07:00
David Sun
59001f827b finished forwarder consumer 2019-07-11 15:15:07 -07:00
David Sun
549bfe98f1 renamed asset-buyer + adding consumers 2019-07-11 15:15:07 -07:00
David Sun
64e3b6f5ee refactored ERC <> ERC for asset-buyer
minor update to interface
2019-07-11 15:15:07 -07:00
David Sun
2fdc0426ff temp fix for CI 2019-07-11 15:15:07 -07:00
F. Eugene Aumson
e6c70fda66 order_utils.py: pin eth-abi version (#1947)
Fixes broken builds due to new release of eth-abi.
2019-07-11 18:08:16 -04:00
Xianny
50da1354f3 Move CLI tests for abi-gen (#1930)
Closes #1925, #1926
2019-07-10 09:19:50 -07:00
Francesco Agosti
e503cacf57 Merge pull request #1916 from 0xProject/feature/website/add-theo
Adding Theo to team page
2019-07-08 13:57:36 -07:00
Fabio B
6a1e0edc78 Fix link to smart contracts 2019-07-08 21:45:40 +02:00
Xianny
048f5c2771 [Multilang] hardcode ABI into abi-gen-wrappers (#1883)
* Export artifacts and addresses from abi-gen-wrappers

* only export addresses, not artifacts

* abi-gen-wrappers no longer accept ContractAbi as constructor param

ABI is now hardcoded when wrapper is generated

* remove unused imports

* remove unused import

* changes after review

* fix method ordering

* update constructor args

* prettier

* statically enumerate ABI properties

* remove abi-gen-wrappers generated-wrappers from prettierignore

* add template for recursive components

* add `indexed` field for EventParameter

* prettier

* update known-good wrappers with ABIs and fix Python ABI loading

* remove generated-artifacts and update gitignore
2019-07-08 12:44:19 -07:00
F. Eugene Aumson
d9378e9a8f First auto-gen'd Python contract wrapper: ERC20 (#1878)
* abi-gen-wrappers: fix half-baked folder rename

* .circleci: give cache more descriptive name

* abi-gen: rename type field. tsName->langLocalName

* contract-artifacts: add devdoc to ERC20Token.json

Artifact changes crafted manually: re-generated artifacts from within
@0x/contracts-erc20, and then copied them into @0x/contract-artifacts,
but only committed the changes that added devdoc.

Modified @0x/contracts-erc20/compiler.json to include devdoc in the
hopes that next time contract-artifacts are re-generated en masse, the
devdoc output will just come along for the ride.

Compiling ERC20 TypeScript wrappers after adding devdoc to the artifacts
revealed some inconsistencies in the types.  ethereum-types'
DevdocOutput REQUIRED many fields which are not always present,
depending the devdoc contents itself.  Relaxing the requirement had some
ramifications.

* abi-gen: Python!

Lots more to come, but so far generating typed methods with some
parameter validation and with reasonable docstrings; enough to make
ERC20 work.

* existing erc20 python wrapper: re-order methods

In order to minimize the diff in the upcoming commit of the
auto-generated version.

* existing erc20 python wrapper: rename method

Rename method _erc20 to _get_contract_instance.

* existing erc20 python wrapper: rename vars

Rename method parameters to match names used in contract methods.

* existing erc20 python wrapper: correction

Contract method `allowance` previously was returning a transaction hash,
but it's a const method, so changed it to return the int that the
underlying method returns.

* contract_wrappers.py: pull in generated code

Custom setup.py command to pull in code previously generated into
../../packages/abi-gen-wrappers/src/generated-wrappers/py.

Changes to existing wrapper code reflect differences between the old,
manually-written wrapper and the new, auto-generated wrapper.

Reconfigured Circle CI to give Python build access to the output of the
TypeScript build, in order to import the generated wrappers from there.

* abi-gen: sanitize docstrings for pycodestyle lint

* abi-gen-templates.py: expose ABI from template

Use ABI given by template, not gotten by name from
zero_ex.contract_artifacts.

Also, expose ABI as a static method.

* py wrappers: contract addr to ctor, not methods

In all Python wrappers (old, manual ones; and new, generated ones), have
client pass the contract address to the wrapper's constructor, rather
than to the individual method calls.

* py wrappers: remove unused param `account_address`

* py wrappers: document use of `private_key`

* Rename file erc20_wrapper.py to erc20_token.py

To match the name of the underlying contract.

* Update CHANGELOG.json's

* git rm erc20_token.py

No need to keep it checked in.  Doing so would require manual overhead
of keeping the generated copy in sync with the generation code, which
may get overlooked and cause confusion for others.  Authoritative source
will be the published package on PyPI.

* abi-gen-templates: tweak CHANGELOG wording

Co-Authored-By: Fabio B <kandinsky454@protonmail.ch>

* Include transaction parameters in const calls too

* Doc contract_address param to gen'd wrapper ctor

* make myself a CODEOWNER of abi-gen*

* rename ids: langLocalName -> languageSpecificName

* Move Python generation to its own packages/ folder

* Stop duplicating contract artifacts in Python pkg!

Thanks to the way we're now using the `./setup.py pre_install`
convention, there's no longer a need to check the artifacts in to the
Python package.

* move py templates BACK to abi-gen-templates

I got a little overzealous in the previous commit that moved ALL the
python stuff into the new packages/python-contract-wrappers folder.

* Update known-good test output: prettify

* add getABIEncodedTransationData to gen'd code

It was added into the template in the following commit, but the
corresponding checked-in generated code was not updated accordingly.

f51c4f9617

* Fix missed instance of languageSpecificName change

* abi-gen: refine pipeline for testing gen'd code

- generate wrappers for test fixture contracts (dummy, etc) not in `yarn
build` but in `yarn test`

- rename folder test/generated-test/generated-wrappers to
test/generated-test/known-good, and stop writing test output to there,
instead writing it to a new test/generated-test/output folder.

- sol-compile test fixture contracts in every test run

- run unit tests separately from tests of generated and built TypeScript
wrappers.  The existing `yarn run_mocha` will run unit tests, and
there's a new `yarn run_contract_wrapper_tests`.

* abi-gen: test Python gen [known test failures]

Also generate TypeScript wrapper test code into a TypeScript folder
(alongside the newly created Python folder).

Known-good code manually corrected (from generated code) to reflect
known problems that still need to be addressed.  Namely:
  - base contract and tx params should be imported from canonical
    package, not relative path. relative path is working for wrapping
    OUR contracts, but would not be usable in a more general
    context.
  - return type missing for some generated methods.

These outstanding problems are currently causing this test to fail.

* fix failing abi-gen test: missing return types

* fix failing abi-gen test: qualify imports

* in py wrapper, simplify base class initialization

per
https://github.com/0xProject/0x-monorepo/pull/1878#discussion_r299248641

* move 3rd party typings to typescript-typings

* make package python-contract-wrappers private

* make Xianny CODEOWNER of base-contract & templates

* abi-gen: clarify --help for --backend

* remove superfluous CHANGELOG entry
2019-07-03 11:01:01 -04:00
Xianny
f77aaaf2e0 Merge pull request #1907 from 0xProject/multilang/add-devdoc
Add devdoc to all contract artifacts
2019-07-02 13:22:04 -07:00
Chris Kalani
380835b151 Added Theo to team page 2019-07-02 12:21:06 -07:00
Xianny
857d91df85 Add dummy contract to test abi-gen-wrappers (#1881) 2019-06-28 15:42:36 -07:00
xianny
cd9a6b0de7 add example devdoc 2019-06-28 13:25:16 -07:00
xianny
86333f4928 add devdocs to all artifacts 2019-06-27 22:00:41 -07:00
F. Eugene Aumson
d1975bd5dd contract-artifacts: add devdoc to ERC20Token.json
Artifact changes crafted manually: re-generated artifacts from within
@0x/contracts-erc20, and then copied them into @0x/contract-artifacts,
but only committed the changes that added devdoc.

Modified @0x/contracts-erc20/compiler.json to include devdoc in the
hopes that next time contract-artifacts are re-generated en masse, the
devdoc output will just come along for the ride.

Compiling ERC20 TypeScript wrappers after adding devdoc to the artifacts
revealed some inconsistencies in the types.  ethereum-types'
DevdocOutput REQUIRED many fields which are not always present,
depending the devdoc contents itself.  Relaxing the requirement had some
ramifications.
2019-06-27 21:08:54 -07:00
David Sun
08b9f27eac Merge pull request #1904 from 0xProject/feature/website/add-dydx-explore
Adding dYdX to Explore page
2019-06-27 10:25:23 -07:00
F. Eugene Aumson
5b2cf8a776 Restore original Python label 2019-06-27 10:03:22 -04:00
F. Eugene Aumson
7394106880 Another attempt at the snake emoji 2019-06-27 09:13:49 -04:00
Chris Kalani
9134a7ae1e Prettier 2019-06-26 17:10:15 -07:00
Chris Kalani
c617e9f483 Adding dYdX to explore page 2019-06-26 17:06:53 -07:00
Xianny
545fcef716 Update autolabeler.yml 2019-06-26 12:42:53 -07:00
David Sun
e20fa3a1bf Merge pull request #1895 from 0xProject/feature/website/new-team-photos-2
Added new team headshots and a couple other small things
2019-06-25 11:32:30 -07:00
Chris Kalani
9d01b47d5b Added better advisor titles 2019-06-25 10:42:03 -07:00
Chris Kalani
fa4c34df41 Removed old StarkDEX announcement link 2019-06-25 10:33:32 -07:00
Chris Kalani
9f8ab4d626 Added new team photos to team page 2019-06-25 10:31:45 -07:00
Alex Browne
1971c9cecd Merge pull request #1879 from 0xProject/remove-albrow-codeowner-contract-tests
Remove @albrow as code owner for contract tests
2019-06-21 11:32:12 -07:00
Amir Bandeali
82f730831d Merge pull request #1863 from 0xProject/feat/contracts/static-call-proxy
Implement StaticCallProxy
2019-06-21 09:18:42 -07:00
Alex Browne
035167e5b7 Remove @albrow as code owner for contract tests 2019-06-20 13:59:17 -07:00
Amir Bandeali
323fb0a965 Bump solidity version pragma for undeployed AssetProxy contracts 2019-06-18 19:52:18 -07:00
Amir Bandeali
45aacf122f Fix StaticCallProxy comment and add sanity checks to TestStaticCallTarget 2019-06-18 19:52:18 -07:00
Amir Bandeali
5dcf7919fc Fix build errors 2019-06-18 19:52:18 -07:00
Amir Bandeali
f15560bd89 Update CHANGELOGs 2019-06-18 19:52:18 -07:00
Amir Bandeali
bf3ae730d6 Add fillOrder tests that use the StaticCallProxy 2019-06-18 19:52:18 -07:00
Amir Bandeali
92ce258bb4 Remove pipeline package from CI build 2019-06-18 19:52:18 -07:00
Amir Bandeali
5810e7df82 Add StaticCallProxy support to LibAssetData 2019-06-18 19:50:59 -07:00
Amir Bandeali
f2cbf4a561 Regenerate abi-gen-wrappers 2019-06-18 19:50:59 -07:00
Amir Bandeali
0c8bb2e675 Add unit tests for StaticCallProxy 2019-06-18 19:50:59 -07:00
Amir Bandeali
f51c4f9617 Allow getABIEncodedTransactionData to be called for read only contract methods 2019-06-18 19:50:59 -07:00
Amir Bandeali
5345f7c983 Add boilerplate for StaticCallProxy 2019-06-18 19:50:59 -07:00
Amir Bandeali
7d9e43b2e1 Add TestStaticCallTarget for testing StaticCallProxy 2019-06-18 19:50:59 -07:00
Amir Bandeali
570c1e1809 Add StaticCallAssetData encoding and decoding 2019-06-18 19:50:59 -07:00
Amir Bandeali
720d335b09 Add StaticCallProxy types and move 1155 method ABI into order-utils 2019-06-18 19:50:59 -07:00
Amir Bandeali
f0ecda1a48 Use more specific revert reason in ERC1155Proxy 2019-06-18 19:50:59 -07:00
Amir Bandeali
4ed111a7d4 Implement StaticCallProxy 2019-06-18 19:50:59 -07:00
Matthew Cadier Kim
fc257523c7 Remove pipeline package
* Remove entire readme for the pipelines package.

* remove pipeline everywhere

* bump circle ci
2019-06-18 17:01:53 -07:00
Xianny
9775f8d83c abi-gen should regenerate contract-wrappers if template files change (#1875) 2019-06-18 16:03:37 -07:00
Xianny
01a1b19556 Prune fields from EthBalanceChecker (#1876)
Remove forbidden fields from EthBalanceChecker
2019-06-18 14:53:26 -07:00
Xianny
bd228034fd Add workflow for copying compiled artifacts to 0x/contract-artifacts (#1842)
The contract artifacts should remain as standard compiler output during development. Fields should only be removed/added prior to being published in `@0x/contract-artifacts`. This PR adds the `yarn transform` script to `@0x/contract-artifacts` to facilitate this. 

Going forward, `abi-gen-templates` will have to support both standard artifacts and modified artifacts if they diverge, since the templates are used for `contract-artifacts`/`abi-gen-wrappers` (modified artifact) *and* development in all the `contracts/*` packages (standard artifact).

This PR makes the following changes to `contract-artifacts`:
- remove `evm.bytecode.linkReferences` from all artifacts
- remove `evm.deployedBytecode` and `sourceTreeHashHex` from Coordinator artifact
- prettify all artifacts (whitespace only changes)
2019-06-17 11:00:53 -07:00
Fabio B
2672a5c59f Merge pull request #1867 from 0xProject/fix/trezorSubprovider
Fix bug in Trezor implementation
2019-06-17 10:18:37 -07:00
Rick Morty
5f383430eb Add CHANGELOG entry 2019-06-15 21:27:09 -07:00
Rick Morty
66ec3e9f4d Hex should be true since the data returned expects it to be hex encoded 2019-06-15 21:23:40 -07:00
Fabio B
c269c427a6 Merge pull request #1865 from 0xProject/feature/ethBalanceChecker
contracts/dev-utils: Add EthBalanceChecker contract to monorepo
2019-06-13 09:37:40 -07:00
Fabio Berger
212855ebd8 Add missing import 2019-06-12 09:29:19 -07:00
Fabio Berger
8f78945a73 Update Python artifact 2019-06-12 09:15:40 -07:00
Fabio Berger
86d50cf597 Remove forbidden fields 2019-06-12 09:10:18 -07:00
Fabio Berger
8986d506a5 Have DevUtils inherit from EthBalanceChecker 2019-06-12 09:08:18 -07:00
Fabio Berger
3d2c945c35 Fix nits in contract 2019-06-12 09:08:04 -07:00
Fabio Berger
8206a3969f Add artifact to Python package 2019-06-11 08:51:51 -07:00
Fabio Berger
43afe67593 Add EthBalanceChecker contract to monorepo 2019-06-11 08:45:15 -07:00
Amir Bandeali
ecf939f8c8 Merge pull request #1848 from 0xProject/feat/contracts/order-validation-fillable-amount
Refactor OrderValidationUtils and create contracts-dev-utils package
2019-06-07 09:11:40 -07:00
Amir Bandeali
f0c4ccfa1e Remove multiple returns from devdoc comments, fix typos 2019-06-07 08:46:52 -07:00
Amir Bandeali
718d48b7d5 Fix linting errors and update CHANGELOGs 2019-06-07 08:46:20 -07:00
Amir Bandeali
d5e88677ae Update tests 2019-06-07 08:46:20 -07:00
Amir Bandeali
b1cfdc7a6a Return 0 balance/allowance if the call would otherwise revert 2019-06-07 08:46:20 -07:00
Amir Bandeali
5c5f815b20 Fix LibAssetData tests 2019-06-07 08:46:20 -07:00
Amir Bandeali
d9edb9675f Add tests for multiAssetData, remove tests for old functions 2019-06-07 08:46:20 -07:00
Amir Bandeali
be6fce5a89 Refactor contracts to only use allowances for AssetProxies (spender is no longer an input) 2019-06-07 08:46:20 -07:00
Amir Bandeali
12afeb30ae Move LibAssetData to DevUtils package 2019-06-07 08:46:20 -07:00
Amir Bandeali
23df406ff0 Fix package.json typos 2019-06-07 08:46:20 -07:00
Amir Bandeali
c9ecef4fc3 Cleanup tests 2019-06-07 08:46:20 -07:00
Amir Bandeali
62f0a867a8 Update CHANGELOGs 2019-06-07 08:46:20 -07:00
Amir Bandeali
f68b8d82e0 Move LibTransactionDecoder to dev-utils package 2019-06-07 08:46:20 -07:00
Amir Bandeali
6b7cb13e9a Move DevUtils contract into its own package 2019-06-07 08:46:19 -07:00
Amir Bandeali
613af6013a Update OrderValidationUtils to return fillableTakerAssetAmount and refactor tests 2019-06-07 08:46:19 -07:00
Amir Bandeali
0db56a781e Cleanup LibAssetData tests 2019-06-07 08:46:19 -07:00
Greg Hysz
fe7674b184 Merge pull request #1837 from 0xProject/fix/contracts/erc1155AssetProxyManualCopyFields
ERC1155 Proxy - Manually Copy Dynamic Fields from Calldata to Memory
2019-06-06 12:20:30 -07:00
Xianny
44a6fe7310 Note on updating contract artifacts (#1853) 2019-06-05 16:59:15 -07:00
Greg Hysen
46690f0c35 Made some comments more readable and fixed some spelling 2019-06-05 15:23:53 -07:00
Greg Hysen
cfc4e345cc ran prettier and updated changelog 2019-06-05 14:22:50 -07:00
Greg Hysen
c68278d824 Additional multiplication overflow checks 2019-06-05 14:09:09 -07:00
Greg Hysen
09600a71cd Added tests to assert that assetData is within the boundaries of calldata 2019-06-05 14:08:25 -07:00
Greg Hysen
d66ba70f5e Updated length to match comment + added explicit test 2019-06-05 14:08:25 -07:00
Greg Hysen
e7c4120d24 Validation checks for the length of asset data 2019-06-05 14:08:25 -07:00
Greg Hysen
1212e534a8 Adds boundary checks when copying dynamic fields (includes tests) 2019-06-05 14:08:25 -07:00
Greg Hysen
899d0f1e42 removed .only for tests 2019-06-05 14:08:25 -07:00
Greg Hysen
dde4ed3754 More readability for 1155 proxy 2019-06-05 14:08:25 -07:00
Greg Hysen
b596e02752 readability cleanup 2019-06-05 14:08:25 -07:00
Greg Hysen
d5afe696da removed .only from tests 2019-06-05 14:08:25 -07:00
Greg Hysen
976be66dee Scale values while copying from calldata 2019-06-05 14:08:25 -07:00
Greg Hysen
98c8a6387a manually copy ids, values, and data fields 2019-06-05 14:08:25 -07:00
Greg Hysen
be1b636e30 Improved readability of ERC1155 Proxy 2019-06-05 14:08:25 -07:00
Greg Hysen
8bae0b81aa Added ERC1155Proxy tests when data overlaps values in asset data 2019-06-05 14:08:25 -07:00
Greg Hysen
7ee19e1306 Added new tests for different lengths of receiver callback data, since we are now appending scaledValues after data. 2019-06-05 14:08:25 -07:00
Greg Hysen
626d0dfa93 Store scaled values and end of calldata in ERC1155 Asset Proxy 2019-06-05 14:08:25 -07:00
Greg Hysz
8453c616a5 Merge pull request #1852 from 0xProject/fix/contracts/expectTransactionFailedAsyncFalsePositives
Fixes false positives in `expectTransactionFailedAsync`
2019-06-05 13:51:59 -07:00
Greg Hysen
56bc2944d0 Fixed false positives in expectTransactionFailedAsync 2019-06-04 18:53:13 -07:00
Amir Bandeali
b2cf701e30 Merge pull request #1850 from 0xProject/removePipelineBuild
Remove pipeline package from build and from CI
2019-06-04 13:20:24 -07:00
Amir Bandeali
9a3b29acb7 Remove pipeline package from build and from CI 2019-06-04 12:58:31 -07:00
Fabio B
85b217f167 Merge pull request #1823 from 0xProject/fix/improveAssertionsAbiGen
Add parameter assertions to abi-gen-wrappers
2019-06-04 19:05:39 +01:00
Fabio Berger
a7700d6c22 Fix tests 2019-06-04 14:38:13 +01:00
Fabio Berger
1e274518dd Remove re-introduced deps 2019-06-04 13:28:13 +01:00
Fabio Berger
f4f8927c79 Update yarn lock 2019-06-04 13:26:35 +01:00
Fabio Berger
60b7890f16 Ensure assertions each get rendered on a new line 2019-06-04 13:26:35 +01:00
Fabio Berger
4d46290ef6 Fix failing tests 2019-06-04 13:26:35 +01:00
Fabio Berger
00f7e2cfc3 Fix linter errors 2019-06-04 13:26:35 +01:00
Fabio Berger
e742708261 Update abi-gen-wrappers 2019-06-04 13:24:29 +01:00
Fabio Berger
8c9de31c5c Add assertions to abi-gen templates and fix tests 2019-06-04 13:19:59 +01:00
Fabio Berger
2bf992f0ac Improve the NOTE in abi-gen utils 2019-06-04 13:18:02 +01:00
Fabio Berger
52a01bcc11 Fix linter errors 2019-06-04 13:18:02 +01:00
Fabio Berger
f250e03c40 Add missing deps 2019-06-04 13:18:01 +01:00
Fabio Berger
75acbfb042 Fi assertion type 2019-06-04 13:18:01 +01:00
Fabio Berger
740fd6f5d9 Rename txData to callData 2019-06-04 13:18:01 +01:00
Fabio Berger
c58306cd49 Add isNumberOrBigNumber assertion 2019-06-04 13:18:01 +01:00
Fabio Berger
985696631c Set liguist-generated to true 2019-06-04 13:18:01 +01:00
Fabio Berger
d8a3d7f920 Fix gitattributes so properly minimizes generate-wrappers in PR review 2019-06-04 13:18:01 +01:00
Fabio Berger
b6b96f0eee Tighten the assertion to hex string 2019-06-04 13:18:01 +01:00
Fabio Berger
3f037ef3cc Add PR number to CHANGELOG entries 2019-06-04 13:18:01 +01:00
Fabio Berger
5c2d3fb3da Update abi-gen-wrappers 2019-06-04 13:18:01 +01:00
Fabio Berger
84d38ea878 Add assertions to abi-gen templates and fix tests 2019-06-04 13:18:01 +01:00
Fabio Berger
6226aa0b23 2019-06-04 13:18:01 +01:00
Fabio Berger
72af35834b Update issue template to instruct submitter to prefix title with package name 2019-06-04 11:52:23 +01:00
David Sun
3019e3817f Merge pull request #1846 from 0xProject/feature/website/starkdex-announcement
Added StarkDEX announcement to homepage
2019-06-03 12:17:02 -07:00
Chris Kalani
da9e90faf0 Added new tab prop to announcement 2019-06-03 11:55:19 -07:00
Chris Kalani
e737395c2b Added StarkDEX announcement to homepage 2019-06-03 11:33:38 -07:00
Fabio B
5a33167594 Merge pull request #1844 from 0xProject/fix/docFixes
website: Doc Fixes
2019-06-03 18:20:09 +01:00
Fabio B
dfb7e50948 Merge pull request #1843 from 0xProject/fix/depSecurityIssues
Fixes the severe security vulnerability warnings on Github
2019-06-03 18:01:58 +01:00
Fabio Berger
b43c9f075c Fix version picker overflow 2019-06-03 12:55:33 +01:00
Fabio Berger
f42ce6adb5 Remove scrollbars onHover behavior as a short-term fix to get cmd-f working for all content on the page 2019-06-03 12:53:16 +01:00
Fabio Berger
bf533bbdbb Remove a bunch of packages from the Docs Home to declutter it a bit 2019-06-03 12:11:20 +01:00
Fabio Berger
9328729c4c Remove devnet mention from metacoin project 2019-06-03 12:02:36 +01:00
Fabio Berger
2e23a044ca Tell users of our Ethereum tools to use with Ganache now that it is supported and given our plans to deprecate devnet 2019-06-03 12:02:24 +01:00
Fabio Berger
691a3a1e72 Fix security vuln by using patched versions of deep-extend 2019-06-03 11:56:42 +01:00
Fabio Berger
fc40f9634b Upgrade tar-fs dep to version without critical security issue 2019-06-03 11:34:59 +01:00
Amir Bandeali
4969441f21 Merge pull request #1835 from 0xProject/feat/contracts/dev-utils
Update OrderValidator and create DevUtils contract
2019-06-01 13:40:10 -07:00
David Sun
d04d50794e Merge pull request #1841 from 0xProject/feature/website/remove-rahul
Removing Rahul from team page
2019-05-31 13:49:57 -07:00
Chris Kalani
5e1fbe34a9 Removed image file 2019-05-31 13:30:50 -07:00
Chris Kalani
2b75829a0c Removing Rahul from team page 2019-05-31 13:29:07 -07:00
Daniel Pyrathon
3b3fd0a3a2 Merge pull request #1803 from 0xProject/instant-callback-done
Added performedCallback attribute for Redux state, and added a hook f…
2019-05-29 14:29:14 -07:00
Daniel Pyrathon
1e4b61008a Merge branch 'development' of github.com:0xProject/0x-monorepo into instant-callback-done 2019-05-29 12:40:20 -07:00
David Sun
ffb71e9fd5 Merge pull request #1840 from 0xProject/fix/website/landing-kit/overflow-issue
Fixed bug with launch kit background
2019-05-29 11:56:54 -07:00
David Sun
c1aeb4bde6 fixing bug with background 2019-05-29 11:53:16 -07:00
David Sun
66bca5cd81 Merge pull request #1822 from 0xProject/feature/website/launch-kit-landing-page
[WIP] Launchkit landing page
2019-05-29 11:49:16 -07:00
F. Eugene Aumson
b68df3a067 Fix static-python-tests (#1839)
* Disable bandit linter on false positive lines

* Shorten docstring to fix linter error
2019-05-29 14:28:17 -04:00
Amir Bandeali
066f3bb646 Return MAX_UINT256 for unlimited allowances in all token standards 2019-05-28 17:01:54 -07:00
David Sun
661c334928 prettier 2019-05-28 12:58:42 -07:00
David Sun
a1895d4157 polished website 2019-05-28 12:58:42 -07:00
David Sun
1e7efe026a committing changes 2019-05-28 12:58:41 -07:00
David Sun
02e7da979a changes to hero 2019-05-28 12:58:41 -07:00
David Sun
bd2839110b Merge pull request #1833 from 0xProject/feature/website/resources-menu
Added Resources dropdown to main nav
2019-05-28 10:05:38 -07:00
Daniel Pyrathon
1bcb2697e7 added prettifier 2019-05-27 19:16:11 -07:00
Daniel Pyrathon
fdb9a664f5 Merge branch 'development' of github.com:0xProject/0x-monorepo into instant-callback-done 2019-05-27 18:54:46 -07:00
Daniel Pyrathon
8099c334c7 Merge branch 'master' of github.com:0xProject/0x-monorepo into instant-callback-done 2019-05-27 18:52:31 -07:00
Daniel Pyrathon
344d28ab78 added prettier 2019-05-27 18:45:08 -07:00
Daniel Pyrathon
5e41168305 removed final bit of performedCallback 2019-05-27 18:35:47 -07:00
Daniel Pyrathon
dd97669cdd removed other legacy code 2019-05-27 18:34:23 -07:00
Daniel Pyrathon
af75581659 removed legacy performedCallback system, and implemented new react-redux system 2019-05-27 18:30:29 -07:00
Amir Bandeali
3c08f5b86a Update CHANGELOGs 2019-05-26 18:00:03 -07:00
Amir Bandeali
7809cad6cb Fix linting errors and warnings 2019-05-26 17:59:53 -07:00
Amir Bandeali
3e59029966 Modify dev utils tests to pass 2019-05-26 17:20:10 -07:00
Amir Bandeali
24249bcb4d Add LibTransactionDecoder to DevUtils 2019-05-26 17:19:45 -07:00
Amir Bandeali
543011c3de Modify batch allowances to take an array of spenders 2019-05-26 17:19:01 -07:00
Amir Bandeali
4d9f2586d9 Remove redundant code, add signature checks to order validations, and create DevUtils contract 2019-05-26 16:15:56 -07:00
Amir Bandeali
7f94ebe362 Add signature validation checks to OrderValidator contract 2019-05-26 15:41:10 -07:00
Amir Bandeali
c9bf1eda54 Small readability and efficiency improvements 2019-05-26 15:33:55 -07:00
Amir Bandeali
2cd4d9004c Create LibAssetProxyIds 2019-05-26 14:39:31 -07:00
Chris Kalani
35cd0319d4 Prettier 2019-05-24 17:50:57 -07:00
Chris Kalani
899030e966 Fixed error, whups 2019-05-24 17:38:04 -07:00
Chris Kalani
15e3944d23 Removed redundant links, fixed linting issues 2019-05-24 17:23:05 -07:00
Chris Kalani
f1fbaedb0f Added Resources dropdown to main nav 2019-05-24 16:09:33 -07:00
Fabio Berger
cf04062a19 Publish
- 0x.js@6.0.10
 - @0x/asset-buyer@6.1.5
 - @0x/connect@5.0.10
 - @0x/contract-wrappers@9.1.4
 - @0x/dev-tools-pages@0.0.27
 - @0x/dev-utils@2.2.3
 - @0x/fill-scenarios@3.0.10
 - @0x/instant@1.0.24
 - @0x/metacoin@0.0.51
 - @0x/migrations@4.1.6
 - @0x/order-utils@8.1.1
 - @0x/order-watcher@4.0.11
 - @0x/pipeline@1.0.21
 - @0x/react-docs@2.0.12
 - @0x/react-shared@2.0.12
 - @0x/sol-compiler@3.1.8
 - @0x/sol-coverage@3.0.5
 - @0x/sol-doc@2.0.12
 - @0x/sol-profiler@3.1.7
 - @0x/sol-trace@2.0.13
 - @0x/sol-tracing-utils@6.0.12
 - @0x/subproviders@4.1.0
 - @0x/testnet-faucets@1.0.80
 - @0x/website@0.0.83
 - @0x/contracts-asset-proxy@2.1.5
 - @0x/contracts-coordinator@2.0.4
 - @0x/contracts-erc1155@1.1.6
 - @0x/contracts-erc20@2.2.5
 - @0x/contracts-erc721@2.1.6
 - @0x/contracts-exchange@2.1.5
 - @0x/contracts-exchange-forwarder@3.0.3
 - @0x/contracts-exchange-libs@2.1.6
 - @0x/contracts-extensions@3.1.5
 - @0x/contracts-multisig@3.1.5
 - @0x/contracts-test-utils@3.1.7
 - @0x/contracts-utils@3.1.6
2019-05-24 16:59:56 +01:00
Fabio Berger
2e922bf7db Updated CHANGELOGS 2019-05-24 16:59:43 +01:00
F. Eugene Aumson
741a731ecb Transaction decoder for Coordinator (#1802)
* Remove unused dependency from erc20/package.json

* Add LibTransactionDecoder

Yet unsupported functions include:
    cancelOrdersUpTo
    executeTransaction
2019-05-24 11:27:53 -04:00
Fabio Berger
91bff1976c Remove react deps from react-highlight in yarn.lock 2019-05-24 14:56:49 +01:00
Fabio B
fad500042a Merge pull request #1830 from 0xProject/feature/fixTrezorInefficiency
subproviders: Fix Trezor subprovider inefficiency
2019-05-24 01:24:40 +01:00
Fabio B
bdb2a01385 Update packages/subproviders/src/subproviders/trezor.ts
Co-Authored-By: Jacob Evans <dekz@dekz.net>
2019-05-24 00:52:33 +01:00
Fabio Berger
f372cd2d13 Add CHANGELOG entry for new Trezor subprovider 2019-05-23 15:52:53 +01:00
Fabio Berger
a435da910f Cache the derived key info since it does not change and currently we request it from the Trezor device for each request 2019-05-23 14:26:15 +01:00
Fabio Berger
f1d96d9673 Fix linter issues 2019-05-23 14:02:55 +01:00
Fabio Berger
45226ee1f6 Update yarn.lock 2019-05-23 14:00:57 +01:00
Fabio B
03b8d29740 Merge pull request #1431 from MarcZenn/feature/subproviders/trezor-subprovider
Feature/subproviders/trezor subprovider
2019-05-23 13:58:34 +01:00
Fabio B
80a4af249f Merge branch 'development' into feature/subproviders/trezor-subprovider 2019-05-23 13:14:09 +01:00
David Sun
900d444946 Merge pull request #1816 from 0xProject/feature/website/add-alex-kroeger
Added Alex Kroeger and removed Leo from team page :(
2019-05-20 10:19:01 -07:00
Fabio B
7ca9393d2d Merge pull request #1820 from 0xProject/fix/updateLaunchKitRepo
website/python-packages: Update 0x-launch-kit repo name to include `-backend`
2019-05-16 21:22:44 -03:00
Fabio Berger
b22d7bb310 Add backend to constant variable name as well 2019-05-16 21:21:54 -03:00
Fabio Berger
c742cdfe5c Update 0x-launch-kit repo name to include -backend 2019-05-16 16:30:48 -03:00
xianny
2d3fe02cd7 Publish
- 0x.js@6.0.9
 - @0x/asset-buyer@6.1.4
 - @0x/connect@5.0.9
 - @0x/contract-wrappers@9.1.3
 - @0x/fill-scenarios@3.0.9
 - @0x/instant@1.0.23
 - @0x/metacoin@0.0.50
 - @0x/migrations@4.1.5
 - @0x/monorepo-scripts@1.0.32
 - @0x/order-utils@8.1.0
 - @0x/order-watcher@4.0.10
 - @0x/pipeline@1.0.20
 - @0x/testnet-faucets@1.0.79
 - @0x/website@0.0.82
 - @0x/contracts-asset-proxy@2.1.4
 - @0x/contracts-coordinator@2.0.3
 - @0x/contracts-erc1155@1.1.5
 - @0x/contracts-erc20@2.2.4
 - @0x/contracts-erc721@2.1.5
 - @0x/contracts-exchange@2.1.4
 - @0x/contracts-exchange-forwarder@3.0.2
 - @0x/contracts-exchange-libs@2.1.5
 - @0x/contracts-extensions@3.1.4
 - @0x/contracts-multisig@3.1.4
 - @0x/contracts-test-utils@3.1.6
 - @0x/contracts-utils@3.1.5
2019-05-15 19:05:54 -04:00
xianny
7d61cb6bac Updated CHANGELOGS 2019-05-15 19:05:44 -04:00
xianny
a804433a7a must run npm with sudo 2019-05-15 18:08:28 -04:00
Xianny
11082320c2 add prepublish check for write permissions for npmjs packages (#1813) 2019-05-15 18:05:56 -04:00
xianny
9f9797b123 remove only flag 2019-05-15 18:02:32 -04:00
Xianny
05d34616b7 fallback to eth_sign if eth_signTypedData fails (#1817)
* fallback to eth_sign if eth_signTypedData fails

lots of wallets/web3providers still don't support the new signing methods
2019-05-15 18:01:55 -04:00
Jacob Evans
c7f474ada1 Merge pull request #1815 from 0xProject/bug/dutchAuctionDecode
Incorrect decode in DutchAuctionWrapper
2019-05-15 10:28:56 +02:00
Chris Kalani
c7328a63d0 Removing Leo's photo from images directory 2019-05-14 16:42:32 -07:00
Chris Kalani
db818794d5 Added Alex Kroeger and removed Leo :( 2019-05-14 16:34:19 -07:00
Jacob Evans
b4b34e4890 Update CHANGELOG 2019-05-14 22:25:30 +02:00
Jacob Evans
eec016380d Commit fix to decode 2019-05-14 19:57:48 +02:00
Jacob Evans
dcab272be0 Add a test for encoding/decoding dutch auction asset data 2019-05-14 19:20:27 +02:00
Fabio Berger
418d033a5c Publish
- 0x.js@6.0.8
 - @0x/asset-buyer@6.1.3
 - @0x/connect@5.0.8
 - @0x/contract-addresses@2.3.3
 - @0x/contract-wrappers@9.1.2
 - @0x/fill-scenarios@3.0.8
 - @0x/instant@1.0.22
 - @0x/metacoin@0.0.49
 - @0x/migrations@4.1.4
 - @0x/order-utils@8.0.2
 - @0x/order-watcher@4.0.9
 - @0x/pipeline@1.0.19
 - @0x/testnet-faucets@1.0.78
 - @0x/website@0.0.81
 - @0x/contracts-asset-proxy@2.1.3
 - @0x/contracts-coordinator@2.0.2
 - @0x/contracts-erc1155@1.1.4
 - @0x/contracts-erc20@2.2.3
 - @0x/contracts-erc721@2.1.4
 - @0x/contracts-exchange@2.1.3
 - @0x/contracts-exchange-forwarder@3.0.1
 - @0x/contracts-exchange-libs@2.1.4
 - @0x/contracts-extensions@3.1.3
 - @0x/contracts-multisig@3.1.3
 - @0x/contracts-test-utils@3.1.5
 - @0x/contracts-utils@3.1.4
2019-05-13 23:14:54 -03:00
Fabio Berger
e7a7713b80 Updated CHANGELOGS 2019-05-13 23:14:30 -03:00
xianny
52a580d845 fix dangling comma 2019-05-13 21:17:25 -04:00
xianny
ea42a0b5f5 version bump 2019-05-13 21:15:38 -04:00
xianny
a0b63da9a6 version bump 2019-05-13 20:57:26 -04:00
Xianny
8d9932fc42 add private key option to migration script (#1811) 2019-05-13 16:32:37 -07:00
Xianny
54be45bedc Update coordinator contracts (#1812)
* update coordinator contracts after redeploying
2019-05-13 16:32:16 -07:00
Jacob Evans
3c9d2a562b Merge pull request #1810 from 0xProject/bug/asset-buyer/remainingTakerAssetAmount
Fix bug where remainingTakerAssetAmount is not converted to BigNumber
2019-05-13 18:53:10 +02:00
Jacob Evans
654bd5175c Add asset-buyer to circleci 2019-05-13 18:19:08 +02:00
Jacob Evans
9db660cd3f Update CHANGELOG 2019-05-13 16:33:29 +02:00
Jacob Evans
9aeadff9bd Check for presence of metadata 2019-05-13 15:38:28 +02:00
Jacob Evans
cd631b789b Commit coverage directory 2019-05-13 13:30:44 +02:00
Jacob Evans
4d98408aaf Fix bug where remainingTakerAssetAmount is not converted to BigNumber 2019-05-13 13:28:59 +02:00
Fabio Berger
490aafba4e Publish
- 0x.js@6.0.7
 - @0x/abi-gen@2.0.10
 - @0x/abi-gen-templates@2.1.0
 - @0x/abi-gen-wrappers@4.3.0
 - @0x/assert@2.0.10
 - @0x/asset-buyer@6.1.1
 - @0x/base-contract@5.1.0
 - @0x/connect@5.0.6
 - @0x/contract-artifacts@1.5.1
 - @0x/contract-wrappers@9.1.0
 - @0x/contracts-gen@1.0.9
 - @0x/dev-tools-pages@0.0.26
 - @0x/dev-utils@2.2.2
 - @0x/fill-scenarios@3.0.6
 - @0x/instant@1.0.21
 - @0x/json-schemas@3.0.10
 - @0x/metacoin@0.0.48
 - @0x/migrations@4.1.2
 - @0x/monorepo-scripts@1.0.31
 - @0x/order-utils@8.0.0
 - @0x/order-watcher@4.0.7
 - @0x/pipeline@1.0.18
 - @0x/react-docs@2.0.11
 - @0x/react-shared@2.0.11
 - @0x/sol-compiler@3.1.7
 - @0x/sol-coverage@3.0.4
 - @0x/sol-doc@2.0.11
 - @0x/sol-profiler@3.1.6
 - @0x/sol-trace@2.0.12
 - @0x/sol-tracing-utils@6.0.11
 - @0x/sra-spec@2.0.10
 - @0x/subproviders@4.0.6
 - @0x/testnet-faucets@1.0.77
 - @0x/utils@4.3.3
 - @0x/web3-wrapper@6.0.6
 - @0x/website@0.0.80
 - @0x/contracts-asset-proxy@2.1.2
 - @0x/contracts-coordinator@2.0.1
 - @0x/contracts-erc1155@1.1.2
 - @0x/contracts-erc20@2.2.1
 - @0x/contracts-erc721@2.1.2
 - @0x/contracts-exchange@2.1.2
 - @0x/contracts-exchange-forwarder@3.0.0
 - @0x/contracts-exchange-libs@2.1.2
 - @0x/contracts-extensions@3.1.2
 - @0x/contracts-multisig@3.1.2
 - @0x/contracts-test-utils@3.1.3
 - @0x/contracts-utils@3.1.2
2019-05-10 14:12:32 -03:00
Fabio Berger
3cd31d49bb Updated CHANGELOGS 2019-05-10 14:12:19 -03:00
Fabio Berger
6dd78b8d35 Update exchange forwarder package version 2019-05-10 13:46:30 -03:00
Jacob Evans
bd51c34098 Merge pull request #1809 from 0xProject/order-watcher-weth-events
OrderWatcher Deposit/Withdraw events
2019-05-10 18:32:31 +02:00
Jacob Evans
0e758fadee Merge changelog entries 2019-05-10 17:53:09 +02:00
Jacob Evans
a67659ff8e Update changelog 2019-05-10 16:37:09 +02:00
Jacob Evans
d1203f90da Revert "Mutate ERC20 ABI to handle WETH Deposit and Withdrawl"
This reverts commit c5f6ebee18.
2019-05-10 16:32:17 +02:00
Jacob Evans
c5f6ebee18 Mutate ERC20 ABI to handle WETH Deposit and Withdrawl 2019-05-10 16:09:09 +02:00
Xianny
41cc5234c4 Add coordinator wrapper (#1792)
* wip first pass at coordinator wrapper

* implement cancels, helper methods, and more unit tests

* pin typeorm version in pipeline

* prettier

* add export to 0x.js

* generate ZeroEx transaction using EIP712

* update Coordinator artifact

* change OrderError -> TypedDataError
2019-05-09 15:48:41 -07:00
Amir Bandeali
c2d3e5f052 Merge pull request #1804 from yxliang01/patch-1
fix.docs(README.md): wrong package name
2019-05-09 10:06:48 -07:00
Jacob Evans
f944b95e32 Added CHANGELOG 2019-05-09 17:26:57 +02:00
Jacob Evans
0a5b919cd9 Add fix for failing test 2019-05-09 16:46:56 +02:00
Jacob Evans
b5f85c11fe Re-enable orderwatcher tests. Add test for WETH withdraw 2019-05-09 16:46:08 +02:00
Greg Hysz
5d44b5e913 Merge pull request #1808 from 0xProject/fix/abiEncoder/typo1
Fixed typo in ABI Encoder error message
2019-05-08 13:27:53 -07:00
Greg Hysen
dd1961d86c updated changelog 2019-05-08 11:22:06 -07:00
Greg Hysen
f3539bf448 fixed typo 2019-05-08 11:22:03 -07:00
David Sun
d831e559f0 Merge pull request #1805 from 0xProject/feature/website/remove-meta-description
Removed default descriptions for website SEO performance
2019-05-07 13:06:15 -07:00
David Sun
cc079660f3 Merge pull request #1800 from 0xProject/feature/website/add-patryk
Added Patryk to the team page
2019-05-07 13:05:58 -07:00
Greg Hysz
4460dac697 Merge pull request #1806 from 0xProject/fix/abiEncoder/multibyteStrings
Support for ABI Encoding multibyte strings (Fixes Issue #1723)
2019-05-07 13:01:53 -07:00
Greg Hysen
31190f921c fixed linter errors 2019-05-07 12:34:05 -07:00
Greg Hysen
22515d8dce updated changelog 2019-05-07 11:59:27 -07:00
Greg Hysen
a099d970a4 Fixes Issue #1723: ABI-Encoded strings can have incorrect length header (multibyte characters) 2019-05-07 11:52:14 -07:00
David Sun
95bb2c5504 removed actual meta tags for description 2019-05-06 16:07:01 -07:00
David Sun
0b1262cc4d removed default description 2019-05-06 15:59:55 -07:00
Xiao Liang
f9244f6f7e fix.docs(README.md): wrong package name 2019-05-07 04:14:19 +08:00
Daniel Pyrathon
9dd4ea1584 added prettifying operations on CI 2019-05-06 12:57:20 -07:00
Daniel Pyrathon
9d085cdb61 applied linting 2019-05-03 18:23:07 -07:00
Daniel Pyrathon
f00a2dbc59 added an unsubscribe handler 2019-05-03 18:05:40 -07:00
Daniel Pyrathon
20862d47ab Added performedCallback attribute for Redux state, and added a hook for callback whenever the transaction was successful 2019-05-03 17:27:26 -07:00
Chris Kalani
cfa1bf36de Fixing Greg's placement in the grid 2019-05-02 14:43:22 -07:00
Chris Kalani
c362b33b5a Added Patryk to the team page 2019-05-02 14:33:36 -07:00
F. Eugene Aumson
222a151eff bump versions, after recent publications (#1646)
* bump versions, after recent publications

* Changelog updates and version bumps

* Correct broken URL's in setup.py's

* Correct SRA Client description (append "Client")

* Add convenience script for uninstalling all pkgs

* Add documentation link to SRA Client README.md
2019-04-30 15:56:40 -04:00
Lawrence Forman
d6115cff25 Merge pull request #1797 from 0xProject/feature/abi-gen-templates/awaitTransactionSuccess
Add awaitTransactionSuccessAsync() to generated contract functions.
2019-04-30 14:13:13 -04:00
Lawrence Forman
6459522617 Merge pull request #1799 from 0xProject/fix/contracts/temporarily-disable-useDockerisedSolc
Disable `useDockerisedSolc` for all contracts `compiler.json`s until latest solc docker images are published
2019-04-30 14:12:31 -04:00
Lawrence Forman
16e1f0eea1 Disable useDockerisedSolc for all contracts compiler.jsons until 0.5.8 docker image is released. 2019-04-30 11:01:31 -04:00
F. Eugene Aumson
0564ac1530 Python doc polish (#1757)
* Exercise doctests as a test not as a linter

* Add a contract artifact doctest, and exercise it

* Clean up linter issues

* Change asset data decoding output type

Previously, it was a TypedDict, but that was causing problems.  Sphinx
seems to be broken, such that none of the fields of the class were being
rendered into the doc.

Thinking on it further, I decided that a NamedTuple makes more sense
here anyways, since tuples are immutable and this output value isn't
something someone should ever build or modify.  And, NamedTuple is
getting its fields properly rendered by Sphinx.

* Add type annotations to JSON schemas docs

* Add doc publish metadata file for middlewares pkg

* Improve documentation

Note that none of the changes to .py files impact functionality in any
way, because the changes are restricted to "docstrings", which to the
Python interpreter are simply no-op statements.

However, one caveat to that is that much of these docstring changes DO
affect the functionality of automated test runs, because all of the code
examples (blocks beginning with `>>> `) are "doctests", which are
exercised via the test framework.

The index.rst files are the top-level templates for generating the
documentation, and the "automodule"/"autoclass"/etc statements pull in
the docstrings from the source code.

* correct package name in doc URL

* Move sra_client module into zero_ex namespace

* Add functions to encode asset data to bytes

* Fix: SRA client was deserializing orders weirdly

The generated code was transforming the order structure, from the camel
case field name format in the spec, into the snake case field name
format expected by Python convention.  With this problem in place, the
only way to take an order from a relayer and send it to a contract (for
fill, cancel, etc) was to manually transform the field names, one by
one, into a new structure.

* Fix problem with Web3/JSON order conversion utils

* doctest: maker, trade ZRX for WETH, not vice versa

* Remove redundant test

* Construct order in native Python, not JSON

Then convert it to JSON before sending it to the relayer.

* doctest: simplify asset units

* Add doctests for filling and cancelling

* Minor doctetst copy edits; whitespace

* Rename function, and add optional parameter

* Tweak docstrings on JSON conversion functions.

* Demo asset data decoding to view asset pairs

* Demo selecting an order from the order book

And have taker take it.

* Rename variable

* Abstract ganache from examples

Doing that exposed excessive use of the verbose
NETWORK_TO_ADDRESSES[NetworkId.Ganache] construct, so simplified that,
which ripped into eliminating other temporary variables that had been
used to hold specific contract addresses.

Also cleaned up some misplaced import statements.

* Add missing SRA client doc publication metadata

* Ran prettier on new SRA client doc pub metadata

* Remove local env customizations in doc metadata

* Eliminate temporary variable

* Rename variable

* Show `pip install` in every package's doc

* Doc NetorkID & pagination params as int, not float

* Clean up unmatched parenthesis in docs
2019-04-30 07:44:51 -04:00
Amir Bandeali
b896f82282 Merge pull request #1798 from 0xProject/feat/clean-contracts
Add clean:contracts command to top level package.json
2019-04-29 16:07:45 -07:00
Amir Bandeali
d737d419d9 Add clean:contracts command to top level package.json 2019-04-29 16:06:00 -07:00
F. Eugene Aumson
0de2b6983b Add LibAssetData to contracts/asset-proxy (#1779)
* Stop restarting node unnecesssarily during test

* Add new, empty LibAssetData

* Support encoding & decoding of ERC20 asset data

* Support encoding & decoding of ERC721 asset data

* Support encoding & decoding of ERC1155 asset data

* Support encoding & decoding of multi-asset data

* Support querying ERC20 balance from asset data

* Support querying ERC721 balance from asset data

* Support querying ERC1155 balance from asset data

* Support querying balance from multi-asset data

* Support querying ERC20 allowance from asset data

* Support querying ERC721 allowance from asset data

* Support querying ERC1155 allowance from asset data

* In tests, wait for allowance set before checking

* Introduce temporary variable `assetDataBody`

* Handle edge case in multi-asset balance query

* Support multi-asset allowance query by asset data

* Move variable declaration up for readability.

* Make all solhint-disable's cite specific rules

And move the directives to the ends of lines whenever possible

* Rename query tests to include " by asset data"

* Extract test helper method

* Extract another test helper method

* Support batch queries of allowances & balances

* In LibAssetData.sol, use IERC1155, not ...Mintable

* Rename balance*() return vars: amount -> balance

* Fix bug in ERC721 balance query

Was using method balanceOf(), but needed to be using ownerOf().

getERC721TokenOwner() method lifted from
@0x/extensions/contracts/src/OrderValidator/OrderValidator.sol

* Reuse new en/decoders; avoid abi.decode().

* Start lowest allowance/balance from 0, not MAX_INT

* Properly implement ERC1155 balance querying

* Split lines for readability

* Also check isApprovedForAll in 721 allowance query

* Add neglected division of allowances by amounts

* Rename methods: balanceOf -> getBalance

* Rename methods: allowance -> getAllowance

* Add methods: getBalanceAndAllowance() & batch...()

* Rename return vars: amount -> allowance

* Add devdoc comments

* Rename batchGet* methods to getBatch*

* Remove refactoring relic

* Add revert messages to all require() calls

* Reduce gas usage for ERC1155 asset data decoding

* Don't use dockerized solc for ERC20 contracts

Because they demand solc version 0.4.26, and it seems as though the tag
for that version has been deleted from dockerhub.

Without this, @0x/contracts-erc20 was failing to build.

* Rename batch functions to use plurals

* Skip dockerized solc for contracts needing 0.4.26

I seems as though the tag for that version has been deleted from
dockerhub.

Without this, these contracts were failing to build.

* Make revert reasons follow snake case convention
2019-04-29 15:46:26 -04:00
Lawrence Forman
25628c34ee Add PR numbers to CHANGELOGs 2019-04-28 22:25:12 -04:00
Lawrence Forman
54fdccd397 Ran prettier. 2019-04-28 22:25:12 -04:00
Lawrence Forman
27af4a988d In @0x/abi-gen-wrappers: Regenerate contract wrappers. 2019-04-28 22:25:12 -04:00
Lawrence Forman
fddad131a2 In @0x/base-contract: Expose txHashPromise in PromiseWithTransactionHash.
In `@0x/abi-gen-templates`: Update `awaitTransactionSuccessAsync()` partial to expose `txHashPromise`.
2019-04-28 22:25:12 -04:00
Lawrence Forman
4d493eeebd In @0x/contracts-asset-proxy: Update tests to use contract-built-in awaitTransactionSuccessAsync(). 2019-04-28 22:25:12 -04:00
Lawrence Forman
14c1495a1a In @0x/abi-gen-templates: Make txData parameter optional in awaitTransactionSuccessAsync().
In `@0x/base-contract`: Make `PromiseWithTransactionHash` class compatible with ES5 transpiler.
In `@0x/abi-gen-wrappers`: Regenerate contract wrappers.
2019-04-28 22:25:12 -04:00
Lawrence Forman
49c029ddb3 In @0x/abi-gen-templates: Add txData parameter to awaitTransactionSuccessAsync.
In `@0x/abi-gen-templates`: Regenerate wrappers.
2019-04-28 22:25:12 -04:00
Lawrence Forman
ddbe142c4c In @0x/abi-gen-wrappers: Regenerate contract wrappers. 2019-04-28 22:25:12 -04:00
Lawrence Forman
4710b40e45 In @0x/abi-gen-templates: Add timeoutMs parameter to awaitTransactionSuccessAsync 2019-04-28 22:25:12 -04:00
Lawrence Forman
be0b296769 Fix more linter errors. 2019-04-28 22:25:12 -04:00
Lawrence Forman
0a0ee67740 Fix linter errors. 2019-04-28 22:25:12 -04:00
Lawrence Forman
943d648225 In @0x/abi-gen-wrappers: Regenerate wrappers. 2019-04-28 22:25:12 -04:00
Lawrence Forman
6d835f5cc1 In @0x/abi-gen-templates: Add awaitTransactionSuccessAsync() to transaction template. 2019-04-28 22:25:12 -04:00
Lawrence Forman
a59cd67acf In @0x/base-contract: expose a PromiseWithTransactionHash type. 2019-04-28 22:25:12 -04:00
Lawrence Forman
bbc06be091 Update contracts/exchange-forwarder to 0.5.5 (#1796)
* Cherry-pick updated `@0x/contracts-exchange-forwarder` from `3.0` branch.

* Add PR numbers to changelogs
2019-04-28 22:21:13 -04:00
David Sun
d303e9f347 Merge pull request #1795 from 0xProject/feature/website/new-sitemap.txt
Added new sitemap.txt
2019-04-26 20:03:59 -04:00
David Sun
85ee923d89 added new sitemap.txt 2019-04-26 20:01:55 -04:00
David Sun
fe6ba20ff5 Merge pull request #1788 from 0xProject/feature/website/seo+polish
Updated meta data for website
2019-04-26 16:24:31 -04:00
Fabio B
18acf50b12 Merge pull request #1789 from 0xProject/fix/order-watcher-race-condition
Fix OrderWatcher race-condition bug
2019-04-24 16:09:58 -05:00
Fabio B
509fabb61c Merge pull request #1733 from PaulRBerg/fix/monorepo-scripts/broken-yarn-command
Fix yarn command in monorepo-scripts
2019-04-23 18:19:33 -05:00
Fabio Berger
cc3378b4cd Add CHANGELOG entry 2019-04-23 18:07:12 -05:00
Fabio Berger
8d3ccf333d Fix race-condition bug 2019-04-23 18:05:33 -05:00
David Sun
520919b165 prettier+lint 2019-04-23 18:41:54 -04:00
Francesco Agosti
600b86dd31 Merge pull request #1787 from 0xProject/feature/instant/utility-methods
Export utility methods and data from instant
2019-04-23 13:21:27 -07:00
fragosti
9c3fdd2584 Export utility methods and data from instant 2019-04-23 13:03:31 -07:00
David Sun
73974cd90f added large card variant 2019-04-23 11:12:36 -04:00
David Sun
8a60b3b402 switched metadata for explore page 2019-04-23 11:05:14 -04:00
Francesco Agosti
59ed5ae6b7 Merge pull request #1785 from 0xProject/feature/instant/erc721-screen-support
Add overflow scroll to instant overlay & fix display bug
2019-04-22 20:39:15 -05:00
fragosti
c687385974 Fix token amount bug 2019-04-22 18:21:32 -07:00
fragosti
2f72e15ea7 Add overflow scroll to instant overlay 2019-04-22 18:07:20 -07:00
Brandon Millman
7ea99baeb2 Merge pull request #1781 from 0xProject/feature/website/add-rui-mason
Added Rui and Mason to the team page
2019-04-22 14:21:11 -07:00
Francesco Agosti
14f3d20772 Merge pull request #1768 from 0xProject/feature/instant/erc-721-support
Super MVP ERC 721 in Instant
2019-04-19 18:21:07 -05:00
fragosti
72f51df25f Change 0x site URL 2019-04-19 17:59:37 -05:00
fragosti
a94b58e304 Remove lodash is undefined 2019-04-19 17:57:06 -05:00
fragosti
d327fabf9c Remove empty switch statement in instant 2019-04-19 17:21:06 -05:00
fragosti
9e02888c74 Apply prettier 2019-04-19 17:05:09 -05:00
fragosti
98c9a847f3 Improve index.html 2019-04-19 16:58:42 -05:00
fragosti
a159f4c9d6 Make ERC721 image fitting more flexible 2019-04-19 16:49:37 -05:00
fragosti
b197731ed2 Add back mysterious change because of merge 2019-04-19 12:34:17 -05:00
fragosti
028f54fdf0 Fix linting errors 2019-04-19 12:28:28 -05:00
fragosti
de62a0f8ed Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/erc-721-support 2019-04-19 11:31:52 -05:00
Chris Kalani
a0fcc50a5f Added Rui and Mason to the team page 2019-04-18 11:58:31 -07:00
Brandon Millman
4f186e843c Merge pull request #1777 from 0xProject/feature/website/add-paul-vienhage
Added Paul to team page, updated 2 photos, cleaned up titles
2019-04-15 09:13:52 -07:00
Chris Kalani
df64c20587 Added Paul to team page, updated 2 photos, cleaned up titles 2019-04-12 16:00:24 -07:00
Jacob Evans
c78a602990 Publish
- 0x.js@6.0.6
 - @0x/abi-gen@2.0.9
 - @0x/abi-gen-templates@2.0.2
 - @0x/abi-gen-wrappers@4.2.0
 - @0x/assert@2.0.9
 - @0x/asset-buyer@6.1.0
 - @0x/base-contract@5.0.5
 - @0x/connect@5.0.5
 - @0x/contract-addresses@2.3.1
 - @0x/contract-artifacts@1.5.0
 - @0x/contract-wrappers@9.0.0
 - @0x/contracts-gen@1.0.8
 - @0x/dev-tools-pages@0.0.25
 - @0x/dev-utils@2.2.1
 - ethereum-types@2.1.2
 - @0x/fill-scenarios@3.0.5
 - @0x/instant@1.0.20
 - @0x/json-schemas@3.0.9
 - @0x/metacoin@0.0.47
 - @0x/migrations@4.1.1
 - @0x/monorepo-scripts@1.0.30
 - @0x/order-utils@7.2.0
 - @0x/order-watcher@4.0.6
 - @0x/pipeline@1.0.17
 - @0x/react-docs@2.0.10
 - @0x/react-shared@2.0.10
 - @0x/sol-compiler@3.1.6
 - @0x/sol-coverage@3.0.3
 - @0x/sol-doc@2.0.10
 - @0x/sol-profiler@3.1.5
 - @0x/sol-resolver@2.0.7
 - @0x/sol-trace@2.0.11
 - @0x/sol-tracing-utils@6.0.10
 - @0x/sra-spec@2.0.9
 - @0x/subproviders@4.0.5
 - @0x/testnet-faucets@1.0.76
 - @0x/tslint-config@3.0.1
 - @0x/types@2.2.2
 - @0x/typescript-typings@4.2.2
 - @0x/utils@4.3.1
 - @0x/web3-wrapper@6.0.5
 - @0x/website@0.0.79
 - @0x/contracts-asset-proxy@2.1.1
 - @0x/contracts-coordinator@2.0.0
 - @0x/contracts-erc1155@1.1.1
 - @0x/contracts-erc20@2.2.0
 - @0x/contracts-erc721@2.1.1
 - @0x/contracts-exchange@2.1.1
 - @0x/contracts-exchange-forwarder@2.1.1
 - @0x/contracts-exchange-libs@2.1.1
 - @0x/contracts-extensions@3.1.1
 - @0x/contracts-multisig@3.1.1
 - @0x/contracts-test-utils@3.1.2
 - @0x/contracts-utils@3.1.1
2019-04-11 17:00:06 +01:00
Jacob Evans
0acec57ba9 Updated CHANGELOGS 2019-04-11 16:59:38 +01:00
Xianny
7423028fea Replace lodash with built-ins where possible to reduce bundle size (#1766)
* add tslint rule to disallow lodash.isUndefined

* add tslint rule to disallow lodash.isNull

* apply fixes
2019-04-10 09:36:32 -07:00
David Sun
49d951b7be Merge pull request #1772 from 0xProject/bug/website-photos
Fix bug with photo name url
2019-04-09 23:44:55 -07:00
David Sun
a554c9518d changed photo name url 2019-04-09 23:43:23 -07:00
David Sun
f3c7ba445e Merge pull request #1771 from 0xProject/feature/website/new-team-photos
Website new team photos
2019-04-09 23:30:51 -07:00
David Sun
3abff41385 commiting photos 2019-04-09 23:08:29 -07:00
Ryan Chow
6c36832f0e Stop using deprecated web3.py interface (#1759)
* Refactor contract function call to support web3.py v5.0.0. (backwards compatible with v4)
2019-04-09 09:33:36 -04:00
fragosti
310c18707b Improve index.html 2019-04-05 16:57:13 -07:00
fragosti
422a4a5578 Add image component 2019-04-05 16:44:17 -07:00
fragosti
a995b2e1ae UI presenting NFT a bit more nicely 2019-04-05 16:25:53 -07:00
fragosti
90ad681a9e Extreme MVP of buying a ERC721 works 2019-04-05 15:55:10 -07:00
David Sun
2ff5c39712 Merge pull request #1767 from dave4506/fix/website/bug-sort-menu
Fix for menu z-index for explore
2019-04-05 15:03:13 -07:00
David Sun
ded849fd6d fix for menu z-index 2019-04-05 15:01:07 -07:00
David Sun
02f7064953 Merge pull request #1763 from dave4506/fix/website/flash-css-error
Fix Explore Issues with flash of css + other minor bugs
2019-04-05 14:57:19 -04:00
David Sun
1ddadfce1e added animation to tiles 2019-04-05 11:26:14 -07:00
David Sun
7720e5007c added animations to explore 2019-04-05 11:17:56 -07:00
David Sun
ccfd021796 switched header 'href' to 'to' 2019-04-05 11:17:56 -07:00
F. Eugene Aumson
fdcad84cee Delete merge conflict artifact (#1758) 2019-04-04 18:08:13 -04:00
Alex Browne
ad3e3b8421 Merge pull request #1755 from 0xProject/fix/circleci-yarn-permission-denied
Fix yarn permission denied errors in CircleCI
2019-04-04 13:21:36 -07:00
Jacob Evans
f67b4f8902 Merge pull request #1747 from 0xProject/feature/cut-the-package-fat
Cut the package fat! Part 1: Unwanted files
2019-04-04 14:26:23 +01:00
Jacob Evans
3c0d7319ba Update artifacts and remove top level artifacts 2019-04-04 12:30:41 +01:00
Jacob Evans
7f0aab6ec6 Remove unused deps 2019-04-04 12:30:41 +01:00
Jacob Evans
669578a926 Add contract-artifacts to circleci 2019-04-04 12:30:41 +01:00
Jacob Evans
fa1db64a8e Add a test to keep artifact sizes down 2019-04-04 12:30:41 +01:00
Jacob Evans
7cf60fa927 Remove sourcecode and opcodes from artifacts 2019-04-04 12:30:41 +01:00
Jacob Evans
75a0d3e494 Update all .npmignores 2019-04-04 12:30:41 +01:00
Jacob Evans
a98218ae22 Whitelist npmignore 2019-04-04 12:30:40 +01:00
Jacob Evans
10952e9dc4 Cut the package fat 2019-04-04 12:30:33 +01:00
Alex Browne
b36e23471b Fix yarn permission denied errors in CircleCI 2019-04-03 17:19:58 -07:00
Alex Browne
f45bf1c95b Merge pull request #1754 from 0xProject/fix/skip-geth-tests-ci
Disable Geth tests in CircleCI
2019-04-03 17:06:09 -07:00
Alex Browne
d4db2587aa Disable Geth tests in CircleCI 2019-04-03 16:38:58 -07:00
F. Eugene Aumson
62e6336a7d Fix race condition in CI runs of Python SRA client tests (#1751)
* In CI, don't start Launch Kit til Ganache is ready

* Re-enable Python SRA client tests

* For local testing, await service readiness
2019-04-03 18:22:26 -04:00
F. Eugene Aumson
2d8acd4711 Disable Python SRA tests against Launch Kit (#1750)
These tests have worked multiple times in Circle CI, but now they're not, and it seems to be misbehaving intermittently, so just disabling them for now.
2019-04-02 13:24:27 -04:00
Brandon Millman
d7d95be042 Merge pull request #1745 from 0xProject/fix/website/fix-codesandbox
Fix code sandbox link and 0x.js dep in website
2019-04-01 10:21:17 -07:00
David Sun
e3c97f0681 Merge pull request #1748 from dave4506/fix/website/pixure+bugs
Switched Pixura link
2019-04-01 08:59:20 -04:00
David Sun
1a4fa015b9 switched back to roboto 2019-04-01 08:54:02 -04:00
David Sun
63dacfaac5 switched pixura link 2019-04-01 08:48:46 -04:00
Brandon Millman
f7263ac2c6 Fix 0x.js dep 2019-03-29 16:54:41 -07:00
Brandon Millman
c7d7e1f0e3 Fix codesandbox link 2019-03-29 16:53:13 -07:00
Daniel Pyrathon
9c54b615f5 Merge pull request #1744 from 0xProject/feature/website/moar-Explore-updates
updates explore page
2019-03-29 16:28:02 -07:00
F. Eugene Aumson
69fe1aa981 Remove doctest skip for get_order method (#1743)
* Remove doctest skip for get_order method

* Set ganache env for Launch Kit in Circle CI

* Unpin Launch Kit version used in CI
2019-03-29 18:54:46 -04:00
rsingireddy
bfb3d19e3b fixes by way of yarn prettier 2019-03-29 15:45:49 -07:00
rsingireddy
0b4e62a63e updates explore page 2019-03-29 15:26:44 -07:00
David Sun
5cdbc03e71 Merge pull request #1676 from dave4506/website/feature/explore-page
Explore page
2019-03-28 21:10:57 -04:00
David Sun
16cd6dd25d removed .DS_Store 2019-03-28 20:54:00 -04:00
David Sun
fc71e7f99f updated to svg assets + new description 2019-03-28 20:51:56 -04:00
David Sun
e740380731 added changes for PR 2019-03-28 17:33:26 -04:00
Jacob Evans
f9921d2c91 Merge pull request #1714 from 0xProject/feature/order-utils/one-sided-transfer-validation
Simulate Maker transfer in order validation
2019-03-28 15:10:00 +01:00
Jacob Evans
d8bfc92cc5 Update documentation and changelog 2019-03-28 14:49:22 +01:00
Jacob Evans
1f2214f891 Major bump as this change could break existing orderbooks 2019-03-28 14:19:33 +01:00
Jacob Evans
50835e317f Update CHANGELOG 2019-03-28 14:00:40 +01:00
Jacob Evans
6c8d4dcc1e Allow simulation taker address to be specified 2019-03-28 14:00:40 +01:00
Jacob Evans
85a7efbd61 Change to accept maker amount 2019-03-28 14:00:40 +01:00
Jacob Evans
6b5ef10467 Remove unused imports 2019-03-28 14:00:39 +01:00
Jacob Evans
0bf46bfcb5 Re-use order relevant state 2019-03-28 14:00:39 +01:00
Jacob Evans
8b8dc7ac78 Update jsdoc 2019-03-28 14:00:39 +01:00
Fabio B
a017122c44 Update packages/contract-wrappers/src/types.ts
Co-Authored-By: dekz <dekz@dekz.net>
2019-03-28 14:00:39 +01:00
Fabio B
86a9a892d2 Update packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
Co-Authored-By: dekz <dekz@dekz.net>
2019-03-28 14:00:39 +01:00
Fabio B
f31a141d78 Update packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
Co-Authored-By: dekz <dekz@dekz.net>
2019-03-28 14:00:39 +01:00
Jacob Evans
fa67997424 Move order_utils from asset-buyer to order-utils package 2019-03-28 14:00:39 +01:00
Jacob Evans
a5f06c577d Remove unused pause 2019-03-28 14:00:38 +01:00
Jacob Evans
e575672877 Update CHANGELOGs 2019-03-28 14:00:38 +01:00
Jacob Evans
a34d5b29e8 Return eventually rejectedWith 2019-03-28 14:00:38 +01:00
Jacob Evans
91ec65da1b Await in tests to prevent clash in before blocks 2019-03-28 14:00:38 +01:00
Jacob Evans
ee8d40a66e Add IAssetProxy to python 2019-03-28 14:00:38 +01:00
Jacob Evans
38ac2e80ed Remove unused code 2019-03-28 14:00:38 +01:00
Jacob Evans
8b70762e34 Add a Test for an Untransferrable ERC20 token 2019-03-28 14:00:37 +01:00
Jacob Evans
18c613a611 Update comments 2019-03-28 14:00:37 +01:00
Jacob Evans
957f8c56a1 validateRemainingOrderAmountIsFillable 2019-03-28 14:00:37 +01:00
Jacob Evans
b16446877e only 2019-03-28 14:00:37 +01:00
Jacob Evans
9164d58dc7 Simulate maker transfer in order validation 2019-03-28 14:00:27 +01:00
Francesco Agosti
0beb2f9d3c Merge pull request #1740 from 0xProject/feature/website/add-Lawrence-change-Mel-role-change-Alex-Browne-role
adds lawrence forman to the website. changes mel role and alex browne…
2019-03-27 11:58:34 -07:00
Brandon Millman
ccdd66052a Merge pull request #1737 from 0xProject/feature/instant/update-infura
[instant] Add infura project id via env variables when bundling instant
2019-03-26 19:04:57 -07:00
Brandon Millman
518fd814b6 Merge branch 'development' into feature/website/add-Lawrence-change-Mel-role-change-Alex-Browne-role 2019-03-26 17:23:58 -07:00
rsingireddy
f49bb78dba adds lawrennce picture 2019-03-26 17:13:56 -07:00
rsingireddy
a54aa77d28 adds lawrence forman to the website. changes mel role and alex browne role 2019-03-26 16:51:07 -07:00
Brandon Millman
f85e443c9c Add instant.0x.org to host domains 2019-03-26 16:33:16 -07:00
Alex Browne
399e004e7f Merge pull request #1738 from 0xProject/fix/test-python-ci-failure-launch-kit-needs-pinning
Pin Launch Kit version in test-python CI task
2019-03-26 16:26:07 -07:00
Michael Huang
3099ba71eb New demos for Python packages (#1734)
End-to-end demos of constructing and signing an order and submitting it to a Relayer.  Docs are generated from the code, and include usage examples that are verified through automated testing.
2019-03-26 19:07:04 -04:00
F. Eugene Aumson
951fcf384c pin launch kit version in test-python ci task 2019-03-26 18:00:16 -04:00
Brandon Millman
c750368a3e Add infura project id via env variables when bundling instant 2019-03-26 14:17:57 -07:00
David Sun
3149d86855 lint + prettier 2019-03-26 16:55:10 -04:00
David Sun
3aaf21e34e removed banner and lint + prettier 2019-03-26 16:20:03 -04:00
David Sun
519c375a42 added responsive features 2019-03-26 16:20:03 -04:00
David Sun
3ed2c732bd added announcement banner 2019-03-26 16:20:02 -04:00
David Sun
0aa5550d0f Rearchitected Explore Page + added new features 2019-03-26 16:20:02 -04:00
David Sun
1bc8dd83d3 added settings dropdown 2019-03-26 16:20:02 -04:00
David Sun
c642cd6fed changed to popular 2019-03-26 16:20:01 -04:00
David Sun
f72918362d created most of the page's functionality 2019-03-26 16:20:01 -04:00
Leonid Logvinov
28c4ca73ab Merge pull request #1728 from ochikov/patch-6
Update constants.ts
2019-03-26 14:46:15 +01:00
Michael Huang
a256494ec8 Python contract wrappers (#1721) 2019-03-25 19:25:41 -04:00
Paul Berg
5fd359a64f Fix yarn command 2019-03-25 19:32:07 +00:00
Michael Huang
e043735362 Fix regex validation on numeric inputs (#1731)
* Fix regex validation on numeric inputs
2019-03-25 15:18:58 -04:00
Amir Bandeali
7010b1adb9 Merge pull request #1729 from 0xProject/feat/coordinator/functionVisibility
Modify function visibilities in Coordinator contract
2019-03-25 11:51:23 -07:00
Amir Bandeali
17ff262729 Update CHANGELOG 2019-03-25 10:11:37 -07:00
Amir Bandeali
1c18838cd8 Fix typos and add tests for decodeOrdersFromFillData 2019-03-25 10:11:37 -07:00
Amir Bandeali
55b87ae78d Make decodeOrdersFromFillData oublic and assertValidTransactionOrdersApproval internal 2019-03-25 10:11:37 -07:00
Amir Bandeali
e446e902f3 Remove TestMixins contract 2019-03-25 10:11:37 -07:00
Amir Bandeali
095b52e0b2 Make hashing methods public 2019-03-25 10:11:37 -07:00
Michael Huang
4f25ff6a50 local_message_signer middleware for web3.py (#1713) 2019-03-25 11:25:41 -04:00
ochikov
6242e0aeec Update constants.ts 2019-03-25 00:21:07 +02:00
Francesco Agosti
fde9fc9dd4 Merge pull request #1722 from 0xProject/fix/instant-polling
Unmount Instant when closing
2019-03-22 17:03:16 -07:00
fragosti
c481e42673 Reset yarn.lock 2019-03-22 16:21:02 -07:00
fragosti
5e228d7232 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into fix/instant-polling 2019-03-22 15:03:15 -07:00
fragosti
6b8e40fdc9 Make unrender idempotent 2019-03-22 15:02:12 -07:00
Alex Svanevik
bca44bf9e3 Merge pull request #1684 from 0xProject/pull-github-data
Pull Github data
2019-03-22 18:33:40 +08:00
askeluv
08e49dcf2e Throttling to respect rate limits 2019-03-22 18:15:49 +08:00
Fabio Berger
0f45409b4d Publish
- 0x.js@6.0.5
 - @0x/abi-gen@2.0.8
 - @0x/abi-gen-wrappers@4.1.0
 - @0x/assert@2.0.8
 - @0x/asset-buyer@6.0.5
 - @0x/base-contract@5.0.4
 - @0x/connect@5.0.4
 - @0x/contract-addresses@2.3.0
 - @0x/contract-artifacts@1.4.0
 - @0x/contract-wrappers@8.0.5
 - @0x/contracts-gen@1.0.7
 - @0x/dev-tools-pages@0.0.24
 - @0x/dev-utils@2.2.0
 - @0x/fill-scenarios@3.0.4
 - @0x/instant@1.0.19
 - @0x/json-schemas@3.0.8
 - @0x/metacoin@0.0.46
 - @0x/migrations@4.1.0
 - @0x/monorepo-scripts@1.0.29
 - @0x/order-utils@7.1.1
 - @0x/order-watcher@4.0.5
 - @0x/pipeline@1.0.16
 - @0x/react-docs@2.0.9
 - @0x/react-shared@2.0.9
 - @0x/sol-compiler@3.1.5
 - @0x/sol-coverage@3.0.2
 - @0x/sol-doc@2.0.9
 - @0x/sol-profiler@3.1.4
 - @0x/sol-resolver@2.0.6
 - @0x/sol-trace@2.0.10
 - @0x/sol-tracing-utils@6.0.9
 - @0x/sra-spec@2.0.8
 - @0x/subproviders@4.0.4
 - @0x/testnet-faucets@1.0.75
 - @0x/types@2.2.1
 - @0x/typescript-typings@4.2.1
 - @0x/utils@4.3.0
 - @0x/web3-wrapper@6.0.4
 - @0x/website@0.0.78
 - @0x/contracts-asset-proxy@2.1.0
 - @0x/contracts-coordinator@1.1.0
 - @0x/contracts-erc1155@1.1.0
 - @0x/contracts-erc20@2.1.0
 - @0x/contracts-erc721@2.1.0
 - @0x/contracts-exchange@2.1.0
 - @0x/contracts-exchange-forwarder@2.1.0
 - @0x/contracts-exchange-libs@2.1.0
 - @0x/contracts-extensions@3.1.0
 - @0x/contracts-multisig@3.1.0
 - @0x/contracts-test-utils@3.1.1
 - @0x/contracts-utils@3.1.0
2019-03-21 17:07:20 +01:00
Fabio Berger
5469d3ec13 Updated CHANGELOGS 2019-03-21 17:07:04 +01:00
Fabio B
d12f8410b9 Merge pull request #1689 from 0xProject/addCoordinatorSupport
Add Coordinator contracts support in dev tools
2019-03-21 16:04:19 +01:00
Fabio Berger
704c52d229 Move @0x/contracts-test-utils dependency from devDep to deps to fix publish test 2019-03-21 15:33:47 +01:00
Fabio Berger
7dcdda14f5 modify types 2019-03-21 15:13:39 +01:00
Fabio Berger
0f59256ca7 merge development 2019-03-21 15:04:52 +01:00
Fabio Berger
ddee04e98c Try import instead of const 2019-03-21 14:46:47 +01:00
Steve Klebanoff
50f5002b71 Unmount component when closing 2019-03-21 14:43:31 +01:00
Fabio Berger
e866add4b0 Add artifacts to python packages 2019-03-21 14:33:54 +01:00
Fabio Berger
39b93b88c5 Fix prettier 2019-03-21 14:32:21 +01:00
Fabio Berger
deb7e95567 Revert change 2019-03-21 14:29:26 +01:00
Jacob Evans
91500501ce Merge pull request #1695 from 0xProject/feature/reduce-excess-block-polling
Reduce excess block polling when using Web3ProviderEngine
2019-03-21 13:37:07 +01:00
Jacob Evans
6a1caeb9a1 Update CHANGELOGs 2019-03-21 12:33:09 +01:00
Jacob Evans
cee7803c37 Remove IAssetProxy 2019-03-21 12:02:38 +01:00
Jacob Evans
4e8d0ac7cb Add IAssetProxy to python 2019-03-21 11:52:43 +01:00
Jacob Evans
47bbcb9935 Add HACK explanation 2019-03-21 11:52:43 +01:00
Jacob Evans
c0288c5f26 Fix changelog, remove migrate_testnet 2019-03-21 11:52:28 +01:00
Jacob Evans
18c2013625 Update contract CHANGELOGs 2019-03-21 11:51:53 +01:00
Jacob Evans
548089888d Remove excess web3providernegine polling from contracts 2019-03-21 11:50:19 +01:00
Jacob Evans
180c65cfeb Change all packages to use web3providerengine without excess polling 2019-03-21 11:50:19 +01:00
Jacob Evans
6a28e41bc8 Remove unnecessary type assertion 2019-03-21 11:50:19 +01:00
Jacob Evans
f9ef942a98 Use providerUtils.startProviderEngine to minimize the HACK 2019-03-21 11:50:18 +01:00
Jacob Evans
8272c7a74e Reduce excess block polling when using Web3ProviderEngine 2019-03-21 11:49:26 +01:00
Amir Bandeali
4e745489db Merge pull request #1720 from 0xProject/fix/remove-tec
Remove TEC package artifacts
2019-03-20 14:01:39 -07:00
Amir Bandeali
fc2625a0c0 Remove TEC package artifacts 2019-03-20 13:28:37 -07:00
Amir Bandeali
d0e43ebaf1 Merge pull request #1712 from merklejerk/fix/feature/contracts/LibAddressArray-tests
Fix LibAddressArray.indexOf() and add LibAddressArray tests.
2019-03-20 11:38:08 -07:00
Fabio Berger
879805e316 merge development 2019-03-20 17:07:02 +01:00
Fabio Berger
6845d2e0ef Add coordinator artifacts to python package 2019-03-20 16:56:08 +01:00
Fabio Berger
542d1c1c41 In-line the declaration 2019-03-20 16:27:13 +01:00
Greg Hysen
31568e7abb Merge pull request #1716 from 0xProject/contracts-asset-proxy/updateProxyId
ERC1155 ProxyId - ERC1155Token -> ERC1155Assets
2019-03-20 08:12:58 -07:00
Lawrence
4b2488b124 Ran prettier. 2019-03-20 10:58:25 -04:00
Leonid Logvinov
d4c37ecfa3 Publish
- 0x.js@6.0.4
 - @0x/abi-gen@2.0.7
 - @0x/abi-gen-wrappers@4.0.3
 - @0x/assert@2.0.7
 - @0x/asset-buyer@6.0.4
 - @0x/base-contract@5.0.3
 - @0x/connect@5.0.3
 - @0x/contract-addresses@2.2.3
 - @0x/contract-wrappers@8.0.4
 - @0x/contracts-gen@1.0.6
 - @0x/dev-tools-pages@0.0.23
 - @0x/dev-utils@2.1.4
 - ethereum-types@2.1.1
 - @0x/fill-scenarios@3.0.3
 - @0x/instant@1.0.18
 - @0x/json-schemas@3.0.7
 - @0x/metacoin@0.0.45
 - @0x/migrations@4.0.4
 - @0x/monorepo-scripts@1.0.28
 - @0x/order-utils@7.1.0
 - @0x/order-watcher@4.0.4
 - @0x/pipeline@1.0.15
 - @0x/react-docs@2.0.8
 - @0x/react-shared@2.0.8
 - @0x/sol-compiler@3.1.4
 - @0x/sol-coverage@3.0.1
 - @0x/sol-doc@2.0.8
 - @0x/sol-profiler@3.1.3
 - @0x/sol-resolver@2.0.5
 - @0x/sol-trace@2.0.9
 - @0x/sol-tracing-utils@6.0.8
 - @0x/sra-spec@2.0.7
 - @0x/subproviders@4.0.3
 - @0x/testnet-faucets@1.0.74
 - @0x/types@2.2.0
 - @0x/typescript-typings@4.2.0
 - @0x/utils@4.2.3
 - @0x/web3-wrapper@6.0.3
 - @0x/website@0.0.77
 - @0x/contracts-asset-proxy@2.0.0
 - @0x/contracts-coordinator@1.0.0
 - @0x/contracts-erc1155@1.0.1
 - @0x/contracts-erc20@2.0.0
 - @0x/contracts-erc721@2.0.0
 - @0x/contracts-exchange@2.0.0
 - @0x/contracts-exchange-forwarder@2.0.0
 - @0x/contracts-exchange-libs@2.0.0
 - @0x/contracts-extensions@3.0.0
 - @0x/contracts-multisig@3.0.0
 - @0x/contracts-test-utils@3.1.0
 - @0x/contracts-utils@3.0.0
2019-03-20 15:26:54 +01:00
Leonid Logvinov
3f9fd7c060 Updated CHANGELOGS 2019-03-20 15:26:43 +01:00
Lawrence
6ed1412bdd Remove unnecessary copy operation in TestLibAddressArray.testAppendRealloc().
Test explicitly for newly allocated address in LibAddressArray "append" tests.
2019-03-20 10:19:46 -04:00
Lawrence
78b9a45158 Add PR#s to changelogs. 2019-03-20 10:19:46 -04:00
Lawrence
b8925baa88 Add unit tests for contracts/utils/LibAddressArray.
Fix `LibAddressArray.indexOf` returning wrong index.
2019-03-20 10:19:46 -04:00
Lawrence
87fd3f2a82 Add RevertReason.InvalidFreeMemoryPtr to packages/types. 2019-03-20 10:19:46 -04:00
Leonid Logvinov
0490ef5900 Merge pull request #1719 from 0xProject/feature/update-soliidty-parser-antlr
Update solidity-parser-antlr
2019-03-20 15:15:11 +01:00
Fabio Berger
8af164dbd2 Attempt to fix type issue 2019-03-20 15:05:21 +01:00
Fabio Berger
c994afbf3c Fix Pylint 2019-03-20 15:02:49 +01:00
Leonid Logvinov
fa36c91bd6 Remove legacy entries from AST Visitor 2019-03-20 14:50:26 +01:00
Fabio Berger
843caf86fb merge development 2019-03-20 14:32:26 +01:00
Leonid Logvinov
5b8f294aaf Update solidity-parser-antlr 2019-03-20 14:31:51 +01:00
Fabio Berger
44eef5b0e0 Fix comment 2019-03-20 14:31:10 +01:00
Fabio B
aad75840d4 Merge pull request #1718 from 0xProject/orderWatcher/fixRaceCondition
Fix race-condition in Order-watcher
2019-03-20 14:19:39 +01:00
Fabio Berger
31faef7030 Add changelog entry 2019-03-20 14:19:25 +01:00
Fabio Berger
941877a05a Fix linter 2019-03-20 13:48:59 +01:00
Fabio B
4fd4c1e8e1 Merge pull request #1717 from ochikov/fix-documentation
Fix documentation typos
2019-03-20 13:47:29 +01:00
Fabio Berger
7cd27cd9c8 Make sure we reset blockchain state 2019-03-20 13:31:55 +01:00
Fabio Berger
54dbef2b4f Add semaphore around event callbacks that all modify shared state 2019-03-20 13:31:35 +01:00
Ognyan Chikov
05424c9f33 Fix documentation typos 2019-03-20 11:37:38 +02:00
askeluv
346c6fc590 Deal with failing Github API for issues 2019-03-20 12:41:56 +08:00
Greg Hysen
7ed3afe9f0 Updated function signature for ERC1155 ProxyId - ERC1155Token -> ERC1155Assets 2019-03-19 15:35:08 -07:00
Greg Hysen
d29ed6cd49 Merge pull request #1715 from 0xProject/update/contract-wrappers/dutchAuctionMainnetAddress
Added Dutch Auction mainnet address to contract-addresses package
2019-03-19 15:18:34 -07:00
Greg Hysen
8c3abf3473 Updated changelog 2019-03-19 15:03:43 -07:00
Greg Hysen
384114d3c7 Added Dutch Auction address on mainnet to contract-addresses package 2019-03-19 15:01:24 -07:00
Greg Hysen
e8be5a0a8f Merge pull request #1673 from 0xProject/feature/contracts/erc1155ProxyIntegrationTests-2
Exchange & Proxy Integration Tests - ERC1155
2019-03-19 11:00:56 -07:00
Greg Hysen
98c6fa10e6 Added 1explicit ERC1555Poxy testsfor cwhen receiver allback data is NULLL (0x) 2019-03-19 09:37:16 -07:00
Greg Hysen
30d0bdec07 Updated changelog and yarn.lock 2019-03-19 09:37:16 -07:00
Greg Hysen
7024f29865 updated changelogs 2019-03-19 09:36:12 -07:00
Greg Hysen
29ebed9514 Added ERC1155 artifacts to log decoder for exchange wrapper 2019-03-19 09:36:11 -07:00
Greg Hysen
c0260bc44a rebased against development 2019-03-19 09:36:11 -07:00
Greg Hysen
6992bff0e0 Ran prettier & linter 2019-03-19 09:36:11 -07:00
Greg Hysen
6957e6e8f7 ERC1155 integration tests with MultiAssetProxy 2019-03-19 09:36:11 -07:00
Greg Hysen
31dbca7efc More integration tests for ERC1155 <> Multi Asset Proxy encoding / decoding 2019-03-19 09:36:11 -07:00
Greg Hysen
82b6dad1ba Exchange Integration Tests 2019-03-19 09:36:11 -07:00
Greg Hysen
5063c17e6b ERC1155 Asset Data tests + types 2019-03-19 09:36:11 -07:00
Amir Bandeali
3fff3d9c60 Merge pull request #1707 from 0xProject/fix/update-ganache
Change `evmVersion` to `constantinople` for contract compilation
2019-03-19 08:23:12 -07:00
Fabio Berger
2fbe0aed32 Fix Python tests 2019-03-19 14:53:43 +01:00
Alex Svanevik
3bdc1802cb Merge branch 'development' into pull-github-data 2019-03-19 14:31:31 +08:00
Francesco Agosti
2675833b0d Merge pull request #1709 from 0xProject/feature/website/add-Daniel
adds daniel pyrahon to website
2019-03-18 14:53:49 -07:00
fragosti
939a5b477a Run linter 2019-03-18 14:51:51 -07:00
Rahul Singireddy
dc57e7a5b3 adds daniel pyrahon to website 2019-03-18 14:19:27 -07:00
Amir Bandeali
a401b8f475 Fix web3wrapper node version test 2019-03-18 13:07:34 -07:00
Amir Bandeali
b008fabdac Change petersburg to constantinople 2019-03-18 13:07:34 -07:00
Amir Bandeali
caf286b8cb Update CHANGELOGs 2019-03-18 13:07:34 -07:00
Amir Bandeali
aea278c022 Update evmVersion to petersburg 2019-03-18 13:07:34 -07:00
Amir Bandeali
4e20fe1602 Update ganache-core to 2.5.3 2019-03-18 13:07:34 -07:00
Fabio Berger
849ca58228 Fix PR number 2019-03-18 20:40:29 +01:00
Fabio Berger
9991fca2e5 Add changelog entry for contract-addressesa 2019-03-18 20:39:02 +01:00
Fabio Berger
9c7bdcfeef Add testnet and mainnet coordinator and coordinatorRegistry addresses 2019-03-18 20:37:01 +01:00
Fabio Berger
b5463d522b Add PR numbers 2019-03-18 17:30:10 +01:00
Fabio Berger
af0d830103 Update coordinator wrapper 2019-03-18 17:20:58 +01:00
Fabio Berger
d4187dffa3 Add createCoordinatorApprovalTypedData method to order-utils and use in Coordinator tests 2019-03-18 17:20:51 +01:00
Fabio Berger
a7f06f2be5 Update coordinator abi-gen-wrapper 2019-03-18 16:44:11 +01:00
Fabio Berger
7ff7d1a185 Merge branch 'development' into addCoordinatorSupport
* development:
  Fix order-watcher version
2019-03-18 12:00:18 +01:00
Fabio Berger
d3ab612a89 Fix order-watcher version 2019-03-18 11:59:56 +01:00
Fabio Berger
e3bc80e027 Merge branch 'development' into addCoordinatorSupport
* development: (93 commits)
  Linting
  Copied MixinAssetProxyDispatcher from exchange
  Added deployed contract packages to readme (and link to top-level readme)
  Bumped version of ERC1155Proxy to 0.5.5 + merged ERC20Proxy/ERC721Proxy/MultiAssetProxy dependencies into base contract files
  Make credits program participants 1 row
  Correct comment in `hashEIP712Message()` in `LibEIP712Domai.sol`. Merge janky changelog notes in `types` package. Correct changelog note in `coordinator` changelog.
  Add PR numbers to changelogs.
  additional zero outcome tests
  renamed perUnitValue to valueMultiplier
  added test for amount=0
  Adjusted changelog version since nothing has been published during this PR
  Added calldatacopy comment
  Do not revert if value or amount are zero. Only if amount is non-zero and there is an overflow.
  updated comment for calldatacopy
  yarn.lock for erc1155 proxy
  added exports for 1155 proxy
  Renamed tokenIds -> ids, tokenValues -> values, callbackData -> data to be consistent with the ERC1155 reference implementation.
  Rebased against development
  Ran prettier
  Updated changelogs and documentation for erc1155 proxy
  ...
2019-03-18 11:20:22 +01:00
Alex Svanevik
a8720806f1 Merge pull request #1702 from 0xProject/fix/pipeline/replace-edps-endpoint
Changed EDPS endpoint to a 0x AWS one
2019-03-18 18:09:31 +08:00
askeluv
5aac4c2e5d Linting 2019-03-18 17:36:19 +08:00
Amir Bandeali
6fa645aab9 Merge pull request #1705 from merklejerk/feature/contracts/coordinator-tx-eip712-mixed-domains
Separate domains for Coordinator transactions and approvals
2019-03-16 16:21:01 -07:00
Greg Hysen
842ea4645b Merge pull request #1701 from 0xProject/feature/contracts/erc1155ProxySolidity055
Upgrade asset-proxy package to solidity 0.5.5
2019-03-15 21:32:57 -07:00
Greg Hysen
e1cfbcd4f6 Copied MixinAssetProxyDispatcher from exchange 2019-03-15 21:16:21 -07:00
Greg Hysen
6f17ff55fa Added deployed contract packages to readme (and link to top-level readme) 2019-03-15 21:16:18 -07:00
Greg Hysen
d88af4dfa6 Bumped version of ERC1155Proxy to 0.5.5 + merged ERC20Proxy/ERC721Proxy/MultiAssetProxy dependencies into base contract files 2019-03-15 19:02:24 -07:00
fragosti
bb0ba21e92 Merge https://github.com/0xProject/0x-monorepo into development 2019-03-15 16:48:41 -07:00
fragosti
f0753c8e58 Make credits program participants 1 row 2019-03-15 16:48:18 -07:00
Lawrence Forman
4c55004b08 Correct comment in hashEIP712Message() in LibEIP712Domai.sol.
Merge janky changelog notes in `types` package.
Correct changelog note in `coordinator` changelog.
2019-03-15 19:23:56 -04:00
Lawrence Forman
ae24119c09 Merge branch 'development' into feature/contracts/coordinator-tx-eip712-mixed-domains 2019-03-15 19:10:44 -04:00
Lawrence Forman
b8753d8f20 Add PR numbers to changelogs. 2019-03-15 18:29:26 -04:00
Greg Hysen
bab368b956 Merge pull request #1661 from 0xProject/feature/contracts/erc1155Proxy-4
ERC1155 Asset Proxy
2019-03-15 15:25:55 -07:00
Greg Hysen
22bc1fb21e additional zero outcome tests 2019-03-15 15:05:52 -07:00
Greg Hysen
63ba764de8 renamed perUnitValue to valueMultiplier 2019-03-15 15:05:52 -07:00
Greg Hysen
6a7530d741 added test for amount=0 2019-03-15 15:05:52 -07:00
Greg Hysen
eb9bf7c4f9 Adjusted changelog version since nothing has been published during this PR 2019-03-15 15:05:52 -07:00
Greg Hysen
b6571d0ca3 Added calldatacopy comment 2019-03-15 15:05:52 -07:00
Greg Hysen
9207d1c680 Do not revert if value or amount are zero. Only if amount is non-zero and there is an overflow. 2019-03-15 15:05:52 -07:00
Greg Hysen
f783c9bb25 updated comment for calldatacopy 2019-03-15 15:05:52 -07:00
Greg Hysen
df5786deda yarn.lock for erc1155 proxy 2019-03-15 15:05:51 -07:00
Greg Hysen
de971e6c46 added exports for 1155 proxy 2019-03-15 15:05:02 -07:00
Greg Hysen
2a6ed0c96e Renamed tokenIds -> ids, tokenValues -> values, callbackData -> data to be consistent with the ERC1155 reference implementation. 2019-03-15 15:05:02 -07:00
Greg Hysen
9ec380777a Rebased against development 2019-03-15 15:05:02 -07:00
Greg Hysen
8916d0d367 Ran prettier 2019-03-15 15:05:02 -07:00
Greg Hysen
1e5648111e Updated changelogs and documentation for erc1155 proxy 2019-03-15 15:05:02 -07:00
Greg Hysen
ae51cfe8b9 Added method descriptions to erc1155 proxy wrapper 2019-03-15 15:05:02 -07:00
Greg Hysen
05ef250ab4 Ran prettier & linter 2019-03-15 15:05:02 -07:00
Greg Hysen
38e4871f32 Moved transferFrom with/without logs into ERC1155 Proxy Wrapper 2019-03-15 15:05:02 -07:00
Greg Hysen
a86ba7af2e moved transferFrom into ERC1155 Proxy Wrapper 2019-03-15 15:05:02 -07:00
Greg Hysen
5704afc54c ERC1155 Asset Data tests + types 2019-03-15 15:05:02 -07:00
Greg Hysen
55c4fc9aca Ran prettier / linter 2019-03-15 15:05:02 -07:00
Greg Hysen
888c17353b Renamed erc1155token to erc1155Contract in proxy tests 2019-03-15 15:05:02 -07:00
Greg Hysen
054c0e91a3 removed erc1155 proxy tests from general proxy test file 2019-03-15 15:05:02 -07:00
Greg Hysen
4dfb610eba updated erc1155 proxy tests and moved to their own test file 2019-03-15 15:05:02 -07:00
Greg Hysen
008eb8dd8b cleaning up erc1155 proxy tests 2019-03-15 15:05:02 -07:00
Greg Hysen
2882c4bb89 test with several tokens erc1155 proxy 2019-03-15 15:05:02 -07:00
Greg Hysen
4473851f5b Remaining tests for erc1155 proxy 2019-03-15 15:05:02 -07:00
Greg Hysen
15d9e2d3d5 Split ERC1155 Asset Proxy from ERC1155 POC implementation - squashed 2019-03-15 15:05:02 -07:00
Greg Hysen
d5d9df383e Added remaining erc1155 revert reasons to types package 2019-03-15 15:05:02 -07:00
Greg Hysen
243a04b756 tests for allowance approvals on erc1155 2019-03-15 15:05:02 -07:00
Greg Hysen
b77dcbd39b bumped revision verson for types package 2019-03-15 15:05:02 -07:00
Lawrence Forman
ad5d4bdfc5 Unexport constants from order-utils.
Directly grab the EIP712 constants from the `order-utils` package in `/contracts/coordinator/test/util/hash_utils`.
Update changelogs.
2019-03-15 18:01:43 -04:00
Lawrence Forman
54c17b0068 Ran prettier & linter.
Updated CHANGELOGs.
2019-03-15 17:32:36 -04:00
Lawrence Forman
616907eff8 Update coordinator tests to comply with mixed EIP712 domains. 2019-03-15 16:52:18 -04:00
Lawrence Forman
afaabb3673 Move Coordinator EIP712 constants from contracts/test-utils to packages/order-utils.
Export `constants` from `packages/types`.
Add `SignatureInvalid` to `RevertReason` in `packages/types`.
2019-03-15 16:52:18 -04:00
Lawrence Forman
1c1f625352 Add SignatureType.Invalid to Coordinator.
`LibEIP712Domain.sol` can now produce hashes for both Coordinator and Exchange data through `hashEIP712CoordinatorMessage()` and `hashEIP712ExchangeMessage()`.
Coordinator now only uses its own domain for approval hashes, and the Exchange's domain for transaction hashes.
2019-03-15 16:52:18 -04:00
fragosti
d3f45d2148 Remove facebook from credits page 2019-03-15 11:30:36 -07:00
Xianny
7326dbd108 add greenhouse (#1690) 2019-03-15 10:37:52 -07:00
F. Eugene Aumson
4bf311a282 Enable cryptokitties data from nonfungible.com (#1680)
* enable cryptokitties

    Recall that nonfungible.com sent us an initial data dump so that we
    wouldn't have to pull everything from the API. And recall that we're
    storing that initial dump on S3. Finally, recall that the cryptokitties
    data was particularly voluminous (~1GB), which doesn't easily transfer to
    and from S3.

    These changes provide a CLI script to partition that data (or any such data
    from nonfungible.com) into a set of smaller files; and a scraping script
    that seamlessly recombines those partitions for loading into the database.

* add chainbreakers, chibifighters & mlbcryptobaseball
2019-03-15 10:50:59 -04:00
F. Eugene Aumson
7f5a3f12ca Relay failures through command line interface (#1700)
* Relay failures through command line interface
2019-03-15 10:38:21 -04:00
askeluv
6a9b71466d Changed endpoint to an AWS one + added increased timeout 2019-03-15 15:52:32 +08:00
Amir Bandeali
70e550a25f Merge pull request #1698 from ochikov/patch-3
Update constants.ts
2019-03-14 20:25:54 -07:00
ochikov
1328882ab6 Update constants.ts 2019-03-14 18:12:50 +02:00
Jacob Evans
b378a0608d Merge pull request #1692 from 0xProject/fix/order-watcher/1550
Fix error where object could be undefined given an approval event
2019-03-14 11:30:54 +01:00
Jacob Evans
e28c6d6f9c Add a regression test for #1550 2019-03-14 10:45:20 +01:00
Jacob Evans
f57f29e426 Update changelog 2019-03-14 10:12:13 +01:00
Jacob Evans
f2857452e3 Fix error were object could be undefined given an approval event 2019-03-14 10:12:03 +01:00
Amir Bandeali
af04c294b9 Merge pull request #1693 from 0xProject/fix/contracts/unpinVersions
Unpin Solidity versions for contracts that are not deployed
2019-03-13 22:34:31 -07:00
Amir Bandeali
65c8630534 Unpin Solidity versions for contracts that are not deployed 2019-03-13 16:53:22 -07:00
askeluv
095882d016 Added Github issue entity 2019-03-13 16:30:10 +08:00
askeluv
1693506f80 name -> full_name + fixed error message for missing access token 2019-03-13 11:47:42 +08:00
Greg Hysen
667c22169f Merge pull request #1657 from 0xProject/feature/contracts/erc1155MinimalImplementation
erc1155 minimal implementation
2019-03-12 12:51:43 -07:00
Greg Hysen
c53edf6bd9 0.5.3 -> 0.5.5 in erc1155 contracts 2019-03-12 11:39:00 -07:00
Greg Hysen
b601220845 Updated package.json dependencies 2019-03-12 11:09:39 -07:00
Greg Hysen
e77a608f45 Got build working on erc1155 2019-03-11 19:07:58 -07:00
Amir Bandeali
2822e77716 Merge pull request #1682 from 0xProject/feat/contracts/solidity0.5.5
Upgrade contracts to Solidity 0.5.5
2019-03-11 17:06:28 -07:00
Greg Hysen
98227928af Added Address.sol for isContract checks to contracts-utils package 2019-03-11 16:12:31 -07:00
Greg Hysen
430afbdc80 Replaced SafeMath in ERC1155 package with the version in contracts-utils 2019-03-11 16:06:18 -07:00
Greg Hysen
dfdb48ce7d Updated README and circleci for erc1155 package 2019-03-11 15:00:41 -07:00
Greg Hysen
257d1b2b52 Set evm version to byzantium to avoid using unsupported opcodes in solidity 0.5.5 2019-03-11 15:00:41 -07:00
Greg Hysen
07200437b6 style improvements for erc1155 basic implementation 2019-03-11 15:00:41 -07:00
Greg Hysen
ebfa00d555 Added remaining erc1155 revert reasons to types package 2019-03-11 15:00:41 -07:00
Greg Hysen
421f555d57 Ran prettier 2019-03-11 14:59:58 -07:00
Greg Hysen
4b60d941cc erc1155 wrapper improvements - handle minting for mutliple addresses at once + more revert reasons 2019-03-11 14:59:58 -07:00
Greg Hysen
60d24ada62 tests for allowance approvals on erc1155 2019-03-11 14:59:58 -07:00
Greg Hysen
a1c121e2fe ignore erc1155 artifacts and wrappers for prettier 2019-03-11 14:59:58 -07:00
Greg Hysen
b3775a3ca5 more style cleanup of erc1155 basic implementation 2019-03-11 14:59:58 -07:00
Greg Hysen
5d36c97a46 Added license to utils 2019-03-11 14:59:58 -07:00
Greg Hysen
4bdd412c15 added pr to changelogs 2019-03-11 14:59:58 -07:00
Greg Hysen
46e3bcd6b9 cleaned up reference implementation revert reasons 2019-03-11 14:59:58 -07:00
Greg Hysen
68a85ddf90 removed unnecessary solhintignore 2019-03-11 14:59:58 -07:00
Greg Hysen
6eba9273cb bumped revision verson for types package 2019-03-11 14:59:58 -07:00
Greg Hysen
9de151cc14 ran prettier 2019-03-11 14:55:45 -07:00
Greg Hysen
b8c9a5dd1f renamed contracts::lib -> contracts::utils 2019-03-11 14:55:45 -07:00
Greg Hysen
4dfb3507c4 updated compiler.json 2019-03-11 14:55:45 -07:00
Greg Hysen
0cac2d407b Cleanup 2019-03-11 14:55:45 -07:00
Greg Hysen
b3106cd932 Removed DummyERC1155Token 2019-03-11 14:55:45 -07:00
Greg Hysen
c4a467fa96 Ran lint-contracts 2019-03-11 14:55:45 -07:00
Greg Hysen
cf7afbe7f6 ran linter 2019-03-11 14:55:45 -07:00
Greg Hysen
a8d58aeac4 ran prettier 2019-03-11 14:55:45 -07:00
Greg Hysen
28209e9413 cleaning 2019-03-11 14:55:45 -07:00
Greg Hysen
68ed56f2d9 some cleanup 2019-03-11 14:55:45 -07:00
Greg Hysen
0c03747807 Basic ERC1155 wrapper 2019-03-11 14:55:45 -07:00
Greg Hysen
dfe7ecbb5b Added erc1155 package to top-level package.json 2019-03-11 14:55:45 -07:00
Greg Hysen
3039d8edfa Ran prettier 2019-03-11 14:55:45 -07:00
Greg Hysen
7c850cc082 Basic ERC1155 Implementation. Derived from reference implementation, with bug fixes. 2019-03-11 14:55:45 -07:00
Alex Browne
0e07ee3d81 Merge pull request #1683 from 0xProject/feature/pipeline-entities-documentation
Add documentation for some pipeline entities
2019-03-11 11:55:43 -07:00
Amir Bandeali
14b820f2c1 Merge pull request #1685 from merklejerk/fix/order-watcher/websocket-1.0.25
Upgrade to websocket@^1.0.26 to fix broken tests
2019-03-11 11:08:28 -07:00
Fabio Berger
9366fa3b45 Add CHANGELOG entries 2019-03-11 15:29:26 +01:00
Fabio Berger
d356e9e65f Add deploying Coordinator contracts to migration script 2019-03-11 14:38:51 +01:00
Fabio Berger
230ebffd0e Generate Coordinator contract wrappers and add to abi-gen-wrappers package 2019-03-11 14:38:35 +01:00
Fabio Berger
5eedc1edca Add Coordinator contracts to contract-artifacts package 2019-03-11 14:38:00 +01:00
Fabio Berger
fa6db9411b Remove unused file 2019-03-11 13:07:38 +01:00
askeluv
b88e42a52d Prettier 2019-03-11 14:33:17 +08:00
askeluv
8d1b27d130 Added entity tests 2019-03-11 14:31:51 +08:00
askeluv
1148d37102 Added comparison details to forks vs main branch 2019-03-11 14:10:08 +08:00
askeluv
88704ce417 Prettier 2019-03-08 20:07:26 +08:00
askeluv
9f69d2cb76 Third entity: Github fork 2019-03-08 20:04:03 +08:00
Lawrence
644f54bfba Update connect package as well because it was also asking for websocket@^1.0.25. 2019-03-08 02:20:23 -08:00
Lawrence
755c4da8cc Add PR 2019-03-08 01:39:45 -08:00
Lawrence
483c77fba8 Remove websocket@1.0.25 entry from yarn.lock so yarn installs websocket@^1.0.26.
Update order-watcher's websocket dependency from ^1.0.25 (broken on some node architectures) to ^1.0.26.
2019-03-08 01:26:28 -08:00
askeluv
55fd71c5e1 Second entity: Github pull request 2019-03-08 14:37:36 +08:00
askeluv
1991bd437f First entity: Github repo 2019-03-08 12:32:21 +08:00
Amir Bandeali
22af796302 Cleanup 2019-03-07 19:36:26 -08:00
Alex Browne
a70931ffbf Add documentation for some pipeline entities. 2019-03-07 18:28:57 -08:00
Amir Bandeali
2f7dd177c1 Update CHANGELOGs 2019-03-07 15:17:56 -08:00
Amir Bandeali
d35a053efd Update remaining contract Solidity versions to 0.5.5 2019-03-07 15:17:51 -08:00
Amir Bandeali
87cc1f9415 Update TEC solidity versions 2019-03-07 14:57:13 -08:00
Amir Bandeali
e7bb524362 Update dependencies and update solc types 2019-03-07 14:57:13 -08:00
Amir Bandeali
9e03e1c742 Merge pull request #1668 from 0xProject/feat/contracts/tec-txorigin-check
Add tx.origin to TEC approvals
2019-03-07 14:55:32 -08:00
Greg Hysen
6fbfcef1fa Merge pull request #1681 from 0xProject/update/codeowners
Updated codeowners
2019-03-07 14:29:57 -08:00
Amir Bandeali
9471510086 Optimize LibAddressArray and update CHANGELOG 2019-03-07 14:29:06 -08:00
Greg Hysen
56320468fd Updated codeowners 2019-03-07 14:16:08 -08:00
Amir Bandeali
53a70bbffb Change InvalidSender err to invalidOrigin 2019-03-07 13:58:50 -08:00
David Sun
4f2e547bd6 Merge pull request #1679 from dave4506/feature/website/add-ethFinex
Add svg file for ethfinex to website
2019-03-07 12:39:52 -08:00
David Sun
af82fa7b62 fixed row issues 2019-03-07 12:35:52 -08:00
Greg Hysen
6bd1a5ab80 Merge pull request #1675 from 0xProject/feature/contracts/TECRegistry-2
Coordinator Registry
2019-03-07 11:49:49 -08:00
Greg Hysen
93568f6fd0 Coordinator Registry + tests 2019-03-07 11:32:18 -08:00
David Sun
1a3bf81c19 linted + prettier 2019-03-07 11:21:30 -08:00
David Sun
2eeabe3998 add svg file for ethfinex 2019-03-07 11:08:25 -08:00
Amir Bandeali
b1d86a7a2d Update yarn.lock 2019-03-07 11:06:17 -08:00
Amir Bandeali
6cfc9ba47b Use != instead of < in loops 2019-03-07 10:56:12 -08:00
Amir Bandeali
350474540b Optimize for loops in LibAddressArray 2019-03-07 10:56:12 -08:00
Amir Bandeali
1136e58de7 Add txOrigin to approvals 2019-03-07 10:56:12 -08:00
Amir Bandeali
558ce4713c Optimize approval hashing 2019-03-07 10:34:10 -08:00
Amir Bandeali
69c6f50dfb Optimize transaction hashing 2019-03-07 10:30:17 -08:00
Greg Hysen
babe01321c Merge pull request #1677 from 0xProject/update/contracts/tecToCoordinator
Rename TEC to Coordinator in contracts
2019-03-07 10:28:47 -08:00
Greg Hysen
ff61dc4391 Updated coordinator name in package.json 2019-03-07 10:13:44 -08:00
Greg Hysen
4da6ede9d0 More tec -> coordinator changes 2019-03-07 10:11:15 -08:00
Greg Hysen
0b1bab873e Updated contracts-tec to contracts-coordinator in package.json 2019-03-07 09:47:59 -08:00
Greg Hysen
6c60341ce8 Changed coordinator domain name to "0x Protocol Coordinator" 2019-03-07 09:28:29 -08:00
Greg Hysen
e1c1878130 Ran linter 2019-03-07 09:11:26 -08:00
Greg Hysen
fea5a39740 Ran prettier 2019-03-07 08:57:30 -08:00
Greg Hysen
9f2221a885 Updated gitignore 2019-03-07 08:37:41 -08:00
Greg Hysen
977cd2505e updated constants for TEC to Coordinator rename 2019-03-07 08:34:11 -08:00
Greg Hysen
e3f85a7c0f Updated README for coordinator package 2019-03-07 08:34:11 -08:00
Greg Hysen
d81339722e Updated CHANGELOG for coordinator package 2019-03-07 08:34:11 -08:00
Greg Hysen
f5c09e02de Remaining TEC -> Coordinator renaming 2019-03-07 08:33:22 -08:00
Greg Hysen
5e102526ec Renamed tec package to coordinator package 2019-03-07 08:33:22 -08:00
Greg Hysen
3c2efd4b67 Rename TEC to Coordinator in contracts 2019-03-07 08:33:22 -08:00
Greg Hysen
7bb93a7c32 Merge pull request #1678 from 0xProject/fix/contracts/solidityUpgradeFix
Fix contracts after Solidity 0.5.5 update
2019-03-07 08:13:01 -08:00
Greg Hysen
ac8f4ae2f9 updated changelogs of contracts packages 2019-03-06 15:45:18 -08:00
Greg Hysen
1ff49188b1 Set evm version to byzantium to avoid using unsupported opcodes in solidity 0.5.5 2019-03-06 15:10:11 -08:00
David Sun
2c329023c2 Merge pull request #1666 from dave4506/feature/website/update-states
Updated stats on website
2019-03-03 18:49:24 -08:00
David Sun
4457a300bf updated 2019-03-03 18:48:37 -08:00
Leonid Logvinov
397496aff0 Publish
- 0x.js@6.0.3
 - @0x/abi-gen@2.0.6
 - @0x/abi-gen-wrappers@4.0.2
 - @0x/assert@2.0.6
 - @0x/asset-buyer@6.0.3
 - @0x/base-contract@5.0.2
 - @0x/connect@5.0.2
 - @0x/contract-wrappers@8.0.3
 - @0x/contracts-gen@1.0.5
 - @0x/dev-tools-pages@0.0.22
 - @0x/dev-utils@2.1.3
 - @0x/fill-scenarios@3.0.2
 - @0x/instant@1.0.17
 - @0x/json-schemas@3.0.6
 - @0x/metacoin@0.0.44
 - @0x/migrations@4.0.3
 - @0x/monorepo-scripts@1.0.27
 - @0x/order-utils@7.0.2
 - @0x/order-watcher@4.0.3
 - @0x/pipeline@1.0.14
 - @0x/react-docs@2.0.7
 - @0x/react-shared@2.0.7
 - @0x/sol-compiler@3.1.3
 - @0x/sol-coverage@3.0.0
 - @0x/sol-doc@2.0.7
 - @0x/sol-profiler@3.1.2
 - @0x/sol-trace@2.0.8
 - @0x/sol-tracing-utils@6.0.7
 - @0x/sra-spec@2.0.6
 - @0x/subproviders@4.0.2
 - @0x/testnet-faucets@1.0.73
 - @0x/utils@4.2.2
 - @0x/web3-wrapper@6.0.2
 - @0x/website@0.0.76
 - @0x/contracts-asset-proxy@1.0.9
 - @0x/contracts-erc20@1.0.9
 - @0x/contracts-erc721@1.0.9
 - @0x/contracts-exchange@1.0.9
 - @0x/contracts-exchange-forwarder@1.0.9
 - @0x/contracts-exchange-libs@1.1.3
 - @0x/contracts-extensions@2.0.8
 - @0x/contracts-multisig@2.0.8
 - @0x/contracts-tec@0.0.4
 - @0x/contracts-test-utils@3.0.8
 - @0x/contracts-utils@2.0.8
2019-03-01 14:34:26 -08:00
Leonid Logvinov
7458fe0d81 Updated CHANGELOGS 2019-03-01 14:34:15 -08:00
Leonid Logvinov
453c81f634 Merge pull request #1663 from 0xProject/fix/sol-profiler
Sol profiler improvements and bug fixes
2019-03-01 14:19:41 -08:00
Leonid Logvinov
eebce4b54d Fix linter errors 2019-03-01 13:59:56 -08:00
Fabio B
f7976e18f1 Update packages/sol-profiler/src/profiler_subprovider.ts
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-03-01 13:46:47 -08:00
Fabio B
d951fe9988 Update packages/sol-tracing-utils/CHANGELOG.json
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-03-01 13:46:42 -08:00
Fabio B
fd4da78075 Update packages/sol-profiler/src/profiler_subprovider.ts
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-03-01 13:46:35 -08:00
Fabio B
a025ae3f54 Update packages/sol-profiler/src/profiler_subprovider.ts
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-03-01 13:46:27 -08:00
Jacob Evans
a75ba0d903 Merge pull request #1662 from 0xProject/bug/move-contracts-test-utils
Move contracts-test-utils to dev dependencies
2019-03-01 10:35:59 -05:00
Alex Svanevik
99318ae2ba Merge pull request #1658 from 0xProject/fix/pipeline/edps-rate-limiting
Added bottleneck for EDPS to deal with rate-limiting
2019-03-01 18:11:18 +08:00
Leonid Logvinov
8369bcb605 Fix linter issues 2019-02-28 22:37:32 -08:00
askeluv
338cc69034 Removed logging 2019-03-01 14:33:19 +08:00
Leonid Logvinov
4526c52fe8 Add PR numbers 2019-02-28 20:23:24 -08:00
Leonid Logvinov
81f9bda502 Add CHANGELOG entries 2019-02-28 20:19:47 -08:00
Leonid Logvinov
46bc5463ca Change the way we access the stack in traces 2019-02-28 20:19:05 -08:00
Leonid Logvinov
bb346537ba Make sol-profiler faster 2019-02-28 20:18:44 -08:00
F. Eugene Aumson
3b5f0d5c30 Adapt to Bloxy API change (#1659)
* Adapt to Bloxy API change

We were using the `days` parameter, but that's no longer available in
the API, so our fetching of previous days (before "today") was broken.

This change gets rid of the concept of "days", and uses the API's new
`from_date` and `till_date` parameters to fetch previous days' trades.

The change to the query in `getLastSeenTimestampAsync()` was necessary
because it was returning a string (despite the `as Array<{ tx_timestamp:
number }>` cast), which was later causing problems trying to pass that
value into `new Date()`.  It worked before because we were doing some
math operations on it (multiplying it by some numbers), so coercion was
saving us.  With the change from a raw query to a `typeorm` call, the
`numberToBigIntTransformer` specified in the `DexTrade` entity is now
doing the proper type conversion for us.

The new `MAX_DAYS` constant in `pull_competing_dex_trades.ts` is
necessary in order to avoid trying to pull data all the way back to 1969
:D, which induces the API to return an HTTP 503.

* Increase trades per query to match current API doc

This is needed in order to be able to pull more than a handful of days
of data at a time (at least, with the script the way its currently
written).
2019-02-28 20:28:00 -05:00
Leonid Logvinov
808ce969d9 Fix a bug with OpCode gas costs being incorrect or NaN 2019-02-28 16:53:59 -08:00
Leonid Logvinov
16f8339f3c Add HEX_BASE to constants 2019-02-28 16:52:18 -08:00
Leonid Logvinov
25d68c3904 Add opCodeToGasCost and opCodeToParamToStackOffset to constants 2019-02-28 16:51:29 -08:00
Leonid Logvinov
77ad8e1a80 Fix a bug when TruffleArtifactAdapter wasn't correctly parsing solc config in the pre 5.0 version of trufle 2019-02-28 16:46:08 -08:00
Jacob Evans
9e8c18075a Move fill-scenarios to devDependecies 2019-02-28 17:48:40 -05:00
Jacob Evans
4278cdfd29 Add CHANGELOG 2019-02-28 17:32:08 -05:00
Jacob Evans
142c2bd0f0 Move contracts-test-utils to dev dependencies 2019-02-28 16:50:23 -05:00
Jacob Evans
13ee8686bb Merge pull request #1660 from 0xProject/bug/log-utils-process
Check for process in browser environments
2019-02-28 16:45:54 -05:00
Jacob Evans
5c06df2635 Update changelog PR 2019-02-28 15:43:07 -05:00
Jacob Evans
d69bf76341 Update CHANGELOG 2019-02-28 15:28:09 -05:00
Jacob Evans
d0d1b295b4 Check for process in browser environments 2019-02-28 15:26:07 -05:00
askeluv
e450191548 Added bottleneck to deal with rate-limiting 2019-02-28 13:08:09 +08:00
Francesco Agosti
3aee83f3d8 Merge pull request #1633 from 0xProject/feature/pipeline/concepts-schema-and-radar-depth-table
[pipeline] Add concepts schema and radar orderbook USD price concept
2019-02-27 20:40:00 -08:00
fragosti
3610a2bc8d Run linter 2019-02-27 20:23:10 -08:00
fragosti
ab559d4620 Include new test path in package.json 2019-02-27 20:11:48 -08:00
fragosti
15d308d4c5 Remove isCli method 2019-02-27 19:34:35 -08:00
Alex Svanevik
e7ea66afb5 Merge pull request #1629 from 0xProject/etherscan-exchange-transactions
Pull exchange contract transactions from Etherscan
2019-02-28 08:30:05 +08:00
David Sun
d9a1d8bde6 Merge pull request #1655 from 0xProject/feature/extensions-page-freds-jank-pr-mirror
Feature/extensions page freds jank pr mirror
2019-02-27 16:38:41 -05:00
Leonid Logvinov
9ac4486403 Merge pull request #1656 from 0xProject/fix/1635
Allow project specific coverage ignore paths by specifying `config.ignoreFilesGlobs`
2019-02-27 13:35:11 -08:00
David Sun
428afabaa3 disabling lint for prettier 2019-02-27 16:21:00 -05:00
Leonid Logvinov
9162189fa6 Add PR numbers 2019-02-27 13:09:30 -08:00
Leonid Logvinov
154ca9b760 Merge branch 'development' into fix/1635 2019-02-27 13:09:04 -08:00
Leonid Logvinov
9fcead3973 Fix the docs 2019-02-27 13:07:03 -08:00
Leonid Logvinov
2fd9d0359c Ignore node_modules, test and interfaces coverage in contracts 2019-02-27 13:06:54 -08:00
Leonid Logvinov
4cf9e030a2 Add ignoreFilesGlobs config option to sol-coverage 2019-02-27 13:06:30 -08:00
David Sun
5570d14179 fixed build issues 2019-02-27 16:05:48 -05:00
David Sun
fd3c546994 changed links 2019-02-27 15:54:09 -05:00
Leonid Logvinov
e81ae05df9 Publish
- 0x.js@6.0.2
 - @0x/asset-buyer@6.0.2
 - @0x/contract-wrappers@8.0.2
 - @0x/instant@1.0.16
 - @0x/metacoin@0.0.43
 - @0x/migrations@4.0.2
 - @0x/order-watcher@4.0.2
 - @0x/pipeline@1.0.13
 - @0x/sol-compiler@3.1.2
 - @0x/sol-coverage@2.0.6
 - @0x/sol-doc@2.0.6
 - @0x/sol-profiler@3.1.1
 - @0x/sol-trace@2.0.7
 - @0x/sol-tracing-utils@6.0.6
 - @0x/testnet-faucets@1.0.72
 - @0x/website@0.0.75
 - @0x/contracts-asset-proxy@1.0.8
 - @0x/contracts-erc20@1.0.8
 - @0x/contracts-erc721@1.0.8
 - @0x/contracts-exchange@1.0.8
 - @0x/contracts-exchange-forwarder@1.0.8
 - @0x/contracts-exchange-libs@1.1.2
 - @0x/contracts-extensions@2.0.7
 - @0x/contracts-multisig@2.0.7
 - @0x/contracts-tec@0.0.3
 - @0x/contracts-test-utils@3.0.7
 - @0x/contracts-utils@2.0.7
2019-02-27 12:45:19 -08:00
Leonid Logvinov
cb394f3a1c Updated CHANGELOGS 2019-02-27 12:45:09 -08:00
David Sun
03ed057ff6 fixed linting + prettier issues 2019-02-27 15:34:24 -05:00
Leonid Logvinov
807290ff38 Merge pull request #1654 from 0xProject/fix/truffle-config-parsing
Fix a bug when TruffleArtifactAdapter was incorrectly parsing the truffle config of the newest version
2019-02-27 12:29:05 -08:00
Leonid Logvinov
40a4b4fa7a Add an explanatory comment 2019-02-27 12:28:41 -08:00
Leonid Logvinov
b7d2ad3651 Merge pull request #1653 from 0xProject/fix/remove-redundant-log
Remove redundant logging from sol-compiler
2019-02-27 12:26:45 -08:00
David Sun
faac286f70 fixed links 2019-02-27 15:21:07 -05:00
David Sun
c6c7f6f907 added title for extensions 2019-02-27 15:01:59 -05:00
fragosti
ccd0da58cb fix build errors 2019-02-27 11:34:04 -08:00
Francesco Agosti
500e5f1b5d Merge pull request #1630 from bakkenbaeck/website-updates
[WIP] Extensions page and tweaks to website
2019-02-27 11:09:57 -08:00
Fred Carlsen
ebb6177271 Update link to whitelist filter 2019-02-27 10:49:41 +01:00
Fred Carlsen
951c256980 Remove redundant fragment 2019-02-27 10:47:59 +01:00
Fred Carlsen
a134ef03dd Update illustrations and copy 2019-02-27 10:45:39 +01:00
Leonid Logvinov
f21a9d16d0 Fix a bug when TruffleArtifactAdapter was incorrectly parsing the truffle config of the newest version 2019-02-26 16:16:44 -08:00
fragosti
42c3bb00ec move to using require.main === module 2019-02-26 16:05:20 -08:00
Leonid Logvinov
0d0fcfe49a Remove redundant logging from sol-compiler 2019-02-26 15:03:06 -08:00
Leonid Logvinov
3f0db92be6 Fix prettier 2019-02-26 14:50:34 -08:00
Leonid Logvinov
ec24c79da1 Publish
- 0x.js@6.0.1
 - @0x/abi-gen@2.0.5
 - @0x/abi-gen-wrappers@4.0.1
 - @0x/assert@2.0.5
 - @0x/asset-buyer@6.0.1
 - @0x/base-contract@5.0.1
 - @0x/connect@5.0.1
 - @0x/contract-wrappers@8.0.1
 - @0x/contracts-gen@1.0.4
 - @0x/dev-tools-pages@0.0.21
 - @0x/dev-utils@2.1.2
 - @0x/fill-scenarios@3.0.1
 - @0x/instant@1.0.15
 - @0x/json-schemas@3.0.5
 - @0x/metacoin@0.0.42
 - @0x/migrations@4.0.1
 - @0x/monorepo-scripts@1.0.26
 - @0x/order-utils@7.0.1
 - @0x/order-watcher@4.0.1
 - @0x/pipeline@1.0.12
 - @0x/react-docs@2.0.6
 - @0x/react-shared@2.0.6
 - @0x/sol-compiler@3.1.1
 - @0x/sol-coverage@2.0.5
 - @0x/sol-doc@2.0.5
 - @0x/sol-profiler@3.1.0
 - @0x/sol-resolver@2.0.4
 - @0x/sol-trace@2.0.6
 - @0x/sol-tracing-utils@6.0.5
 - @0x/sra-spec@2.0.5
 - @0x/subproviders@4.0.1
 - @0x/testnet-faucets@1.0.71
 - @0x/types@2.1.1
 - @0x/utils@4.2.1
 - @0x/web3-wrapper@6.0.1
 - @0x/website@0.0.74
 - @0x/contracts-asset-proxy@1.0.7
 - @0x/contracts-erc20@1.0.7
 - @0x/contracts-erc721@1.0.7
 - @0x/contracts-exchange@1.0.7
 - @0x/contracts-exchange-forwarder@1.0.7
 - @0x/contracts-exchange-libs@1.1.1
 - @0x/contracts-extensions@2.0.6
 - @0x/contracts-multisig@2.0.6
 - @0x/contracts-tec@0.0.2
 - @0x/contracts-test-utils@3.0.6
 - @0x/contracts-utils@2.0.6
2019-02-26 14:45:52 -08:00
Leonid Logvinov
f5fffbea04 Updated CHANGELOGS 2019-02-26 14:45:42 -08:00
Amir Bandeali
fb0a2ef248 Merge pull request #1545 from 0xProject/feat/contracts/tec
TEC MVP
2019-02-26 14:24:30 -08:00
Leonid Logvinov
240f482e8e Merge pull request #1652 from 0xProject/fix/sol-compiler-settings
Fix a bug when combining sol-compiler settings from different sources
2019-02-26 14:15:37 -08:00
Leonid Logvinov
885031d3ce Add PR number 2019-02-26 14:15:23 -08:00
fragosti
eb212de70e run linter and add doc string 2019-02-26 14:05:18 -08:00
Amir Bandeali
68323d6def Fix geth tests 2019-02-26 14:00:21 -08:00
Leonid Logvinov
7c492071f1 Merge pull request #1647 from 0xProject/feature/sol-profiler-ganache
Sol-profiler ganache
2019-02-26 13:53:55 -08:00
fragosti
8fbdef2a1d Make job look at last timestamp, fix tests 2019-02-26 13:52:18 -08:00
Leonid Logvinov
8f64784781 Fix a bug when combining sol-compiler settings from different sources 2019-02-26 13:50:45 -08:00
David Sun
1bd6095c60 Merge pull request #1651 from dave4506/fix/website/add-temporary-seo
Added temporary metadata
2019-02-26 16:38:59 -05:00
David Sun
e133a5f0f3 added temporary metadata 2019-02-26 16:38:09 -05:00
Amir Bandeali
b47886416e Unpin deps when unnecessary 2019-02-26 13:29:18 -08:00
Amir Bandeali
c522d611d1 Fix typos 2019-02-26 13:29:18 -08:00
Amir Bandeali
f6d9b6b7aa Remove unused deps 2019-02-26 13:29:18 -08:00
Amir Bandeali
1de6bca12d Add TEC integration tests 2019-02-26 13:29:18 -08:00
Amir Bandeali
2de9b862d8 Add more verification test cases 2019-02-26 13:29:18 -08:00
Amir Bandeali
3c649df3df simplify approval verification logic 2019-02-26 13:29:18 -08:00
Amir Bandeali
9bf38d9e4d Add 'contains' function to LibAddressArray 2019-02-26 13:29:18 -08:00
Amir Bandeali
dee40f038d Add more approval verification tests 2019-02-26 13:29:18 -08:00
Amir Bandeali
d0aa907418 Add TEC revert reasons 2019-02-26 13:29:18 -08:00
Amir Bandeali
8dbdffc9b4 Fix abi decoding of 0x transaction data 2019-02-26 13:29:17 -08:00
Amir Bandeali
f409780455 Add ApprovalFactory class 2019-02-26 13:29:17 -08:00
Amir Bandeali
bebcd99b3b Add signature validator tests 2019-02-26 13:29:17 -08:00
Amir Bandeali
99aeaddf42 Make internal functions public 2019-02-26 13:29:17 -08:00
Amir Bandeali
793398216f Update deps versions 2019-02-26 13:29:17 -08:00
Amir Bandeali
b353ed3157 Update deps versions 2019-02-26 13:29:17 -08:00
Amir Bandeali
8637212a17 temp 2019-02-26 13:29:17 -08:00
Amir Bandeali
c42ce38e1c Bump dep versions 2019-02-26 13:29:17 -08:00
Amir Bandeali
76d228a603 Bump solidity version 2019-02-26 13:29:17 -08:00
Amir Bandeali
5cb52faa10 Do not verify orders with a null senderAddress 2019-02-26 13:29:17 -08:00
Amir Bandeali
e67e822845 Add tests for hashing libs 2019-02-26 13:29:17 -08:00
Amir Bandeali
a52686ca3b Fix README typos 2019-02-26 13:29:17 -08:00
Amir Bandeali
7a1e6cccfd Add public wrappers for libs 2019-02-26 13:29:17 -08:00
Amir Bandeali
1166b6c2fb Do not check approvals for orders where sender == feeRecipient 2019-02-26 13:29:17 -08:00
Amir Bandeali
7a6693694c Update README 2019-02-26 13:29:17 -08:00
Amir Bandeali
6ed423d1af Make all cancels permissionless 2019-02-26 13:29:17 -08:00
Amir Bandeali
8b69444602 Add tec package to relevant files 2019-02-26 13:29:17 -08:00
Amir Bandeali
7de5e8d9c8 Update READMEs 2019-02-26 13:29:17 -08:00
Amir Bandeali
844e3d1934 Implement TEC MVP 2019-02-26 13:29:17 -08:00
Amir Bandeali
9eafbbc0ae Update solidity versions of relevant contracts 2019-02-26 13:29:17 -08:00
Amir Bandeali
74677e3d54 Rename getTransactionHex to getTransactionHashHex for clarity 2019-02-26 13:29:17 -08:00
Amir Bandeali
57f4638742 Update CHANGELOGs 2019-02-26 13:29:17 -08:00
Amir Bandeali
c7a32f2d56 Update dep versions 2019-02-26 13:29:17 -08:00
Leonid Logvinov
d2dc64aa2d Rename idx to index 2019-02-26 13:25:26 -08:00
Fabio B
edb2a34c51 Update packages/sol-tracing-utils/src/utils.ts
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-02-26 13:13:56 -08:00
Leonid Logvinov
dbd9b1c5c4 Add CHANGELOG entry 2019-02-26 11:00:37 -08:00
Leonid Logvinov
c3b758845d Refactor structLogs normalization to handle ganache 2019-02-26 10:55:58 -08:00
Leonid Logvinov
4d770549fc Fix stack content reporting in custom JS tracer 2019-02-26 10:55:40 -08:00
Leonid Logvinov
a67674bae1 Fix memory cost computing 2019-02-26 10:54:54 -08:00
Leonid Logvinov
462a61da73 Move structLogs normalization right after we fetch the trace 2019-02-26 10:54:00 -08:00
Leonid Logvinov
ae8a7f6320 Remove ganache profiling warning 2019-02-26 10:50:14 -08:00
Leonid Logvinov
a23c6a0996 Fix linter issues 2019-02-26 10:03:42 -08:00
Fred Carlsen
e6594cecce Fix jumping part of animated hero logo 2019-02-26 12:41:09 +01:00
askeluv
85ed5d27f5 Bumped up timeout to 4 mins 2019-02-26 19:37:59 +08:00
askeluv
6ac9e11245 Linting 2019-02-26 11:46:21 +08:00
askeluv
9fbd809344 Improved testing - added fixtures 2019-02-26 11:42:53 +08:00
David Sun
63a098d757 Merge pull request #1643 from dave4506/feature/remove-website-vote
Removed announcement
2019-02-25 20:23:18 -05:00
David Sun
b68d9ed672 removed announcement 2019-02-25 20:21:49 -05:00
Leonid Logvinov
5934eb0559 Publish
- 0x.js@6.0.0
 - @0x/abi-gen@2.0.4
 - @0x/abi-gen-templates@2.0.1
 - @0x/abi-gen-wrappers@4.0.0
 - @0x/assert@2.0.4
 - @0x/asset-buyer@6.0.0
 - @0x/base-contract@5.0.0
 - @0x/connect@5.0.0
 - @0x/contract-addresses@2.2.2
 - @0x/contract-wrappers@8.0.0
 - @0x/contracts-gen@1.0.3
 - @0x/dev-tools-pages@0.0.20
 - @0x/dev-utils@2.1.1
 - ethereum-types@2.1.0
 - @0x/fill-scenarios@3.0.0
 - @0x/instant@1.0.14
 - @0x/json-schemas@3.0.4
 - @0x/metacoin@0.0.41
 - @0x/migrations@4.0.0
 - @0x/monorepo-scripts@1.0.25
 - @0x/order-utils@7.0.0
 - @0x/order-watcher@4.0.0
 - @0x/pipeline@1.0.11
 - @0x/react-docs@2.0.5
 - @0x/react-shared@2.0.5
 - @0x/sol-compiler@3.1.0
 - @0x/sol-coverage@2.0.4
 - @0x/sol-doc@2.0.4
 - @0x/sol-profiler@3.0.0
 - @0x/sol-resolver@2.0.3
 - @0x/sol-trace@2.0.5
 - @0x/sol-tracing-utils@6.0.4
 - @0x/sra-spec@2.0.4
 - @0x/subproviders@4.0.0
 - @0x/testnet-faucets@1.0.70
 - @0x/types@2.1.0
 - @0x/typescript-typings@4.1.0
 - @0x/utils@4.2.0
 - @0x/web3-wrapper@6.0.0
 - @0x/website@0.0.73
 - @0x/contracts-asset-proxy@1.0.6
 - @0x/contracts-erc20@1.0.6
 - @0x/contracts-erc721@1.0.6
 - @0x/contracts-exchange@1.0.6
 - @0x/contracts-exchange-forwarder@1.0.6
 - @0x/contracts-exchange-libs@1.1.0
 - @0x/contracts-extensions@2.0.5
 - @0x/contracts-multisig@2.0.5
 - @0x/contracts-test-utils@3.0.5
 - @0x/contracts-utils@2.0.5
2019-02-25 13:35:29 -08:00
Leonid Logvinov
b998d719a6 Updated CHANGELOGS 2019-02-25 13:35:17 -08:00
Leonid Logvinov
33832244cf Merge pull request #1638 from 0xProject/feature/sol-profiler-improvements
Sol profiler improvements
2019-02-25 13:19:51 -08:00
Fabio B
df8ea3b65c Merge pull request #1641 from 0xProject/fixAddresses
Fix OrderValidator and Forwarder addresses in Python package
2019-02-25 15:57:21 -05:00
Leonid Logvinov
7067d4a499 Fix prettier 2019-02-25 12:53:42 -08:00
Leonid Logvinov
3e764eafd9 Use contracts-test-utils in metacoin 2019-02-25 12:52:21 -08:00
Leonid Logvinov
4169a41eda Rename traceInfo.data to traceInfo.dataIfExists 2019-02-25 12:40:10 -08:00
Leonid Logvinov
379eab19ad FIx CHANGELOGs 2019-02-25 12:35:57 -08:00
Fabio B
6cba1f3b61 Update packages/sol-profiler/CHANGELOG.json
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-02-25 12:34:18 -08:00
Fabio B
5dad2404d3 Update packages/ethereum-types/src/index.ts
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-02-25 12:33:58 -08:00
Fabio B
a1b20eea2c Update packages/ethereum-types/src/index.ts
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-02-25 12:33:50 -08:00
Fabio Berger
af075e7b8b Fix OrderValidator and Forwarder addresses in Python package 2019-02-25 15:05:18 -05:00
Amir Bandeali
ef0a699919 Merge pull request #1604 from 0xProject/feat/exchange-libs/solc5.0
Update exchange-libs and utils Solidity versions + bugfix
2019-02-25 10:29:52 -08:00
Amir Bandeali
8279ef0e05 Add more slice tests 2019-02-25 10:12:59 -08:00
Amir Bandeali
c1cee8e951 Run lerna link before building 2019-02-25 09:59:25 -08:00
Amir Bandeali
4c17373311 Update dep versions 2019-02-25 09:59:25 -08:00
Amir Bandeali
c20972de3f Update CHANGELOGs 2019-02-25 09:59:25 -08:00
Amir Bandeali
64401f1031 Fix bug in slice functions that disallow slicing the last byte of a byte array 2019-02-25 09:59:25 -08:00
Amir Bandeali
1f895d0f27 Make constants internal 2019-02-25 09:59:25 -08:00
Amir Bandeali
5aa8ea10c3 Upgrade solc version to 0.5.3 for exchange-libs and utils 2019-02-25 09:59:25 -08:00
Fred Carlsen
cf65d4a909 Prettier fixes 2019-02-25 15:32:57 +01:00
Fred Carlsen
079f627b34 Fix linting issues 2019-02-25 15:29:24 +01:00
Fred Carlsen
f6c6cbc343 Constrain icon size to container 2019-02-25 15:22:48 +01:00
Fred Carlsen
c6cdea77b6 Fix website errors related to props/children 2019-02-25 15:22:35 +01:00
Jacob Evans
b1fd3429ae Merge pull request #1639 from 0xProject/vote/zeip-23-pst-end-date
Change vote end date to end on PST 25/02/2019
2019-02-24 12:29:07 -08:00
Jacob Evans
dc161ef08d Change vote end date to end on PST 25/02/2019 2019-02-24 12:01:45 -08:00
Leonid Logvinov
9502e789b3 Move constants up 2019-02-22 19:47:29 -08:00
Leonid Logvinov
a71aed0233 Run prettier 2019-02-22 18:16:38 -08:00
Leonid Logvinov
eda8dc278b Remove excesive exports 2019-02-22 18:01:19 -08:00
Leonid Logvinov
23a7ffb167 Fix linter 2019-02-22 17:35:14 -08:00
Leonid Logvinov
ab11aaa694 Export ContractAbi from sol-tracing-utils 2019-02-22 16:58:57 -08:00
Leonid Logvinov
83b5a2709d Remove commented code 2019-02-22 16:57:50 -08:00
Leonid Logvinov
f67f94fd6b Rename logHeader to header 2019-02-22 16:28:04 -08:00
Leonid Logvinov
4e8ae037bb Add PR numbers 2019-02-22 16:23:04 -08:00
Leonid Logvinov
04d8f46ff3 Major sol-profiler overhaul 2019-02-22 16:16:03 -08:00
fragosti
3191de68b8 Fix typo in query 2019-02-22 16:13:48 -08:00
Leonid Logvinov
047de370d6 Add logUtils.table and logUtils.header 2019-02-22 16:12:34 -08:00
Leonid Logvinov
e21dc5f026 Add all existing opcodes to OpCode 2019-02-22 16:06:55 -08:00
fragosti
f3da56773e Run prettier 2019-02-22 12:02:58 -08:00
fragosti
5197758579 Add missing file 2019-02-22 10:36:30 -08:00
Fred Carlsen
d48af7c4c2 Add icons 2019-02-22 13:42:17 +01:00
Fred Carlsen
bbafe0fc46 Add link to extensions in footer 2019-02-22 13:27:18 +01:00
Fred Carlsen
9a91f917e0 Tweak cards + add links 2019-02-22 13:03:30 +01:00
Fred Carlsen
1f681f02ae More cleanup 2019-02-22 11:23:55 +01:00
Fred Carlsen
778a86e7eb Fix linting issues 2019-02-22 11:18:04 +01:00
Fabio B
78da033441 Merge pull request #1627 from 0xProject/supportEIP1193Providers
Support EIP1193 provider interface
2019-02-21 20:26:25 -08:00
askeluv
6eb923d22f Throw error when API key is missing + use response in parser test 2019-02-22 11:21:33 +08:00
fragosti
e602afcd5f add documentation 2019-02-21 18:24:11 -08:00
askeluv
bf1115d417 Backfills automatically + prettier 2019-02-22 09:45:25 +08:00
Fabio Berger
b51038b9e7 Merge branch 'development' into supportEIP1193Providers
* development:
  Demonstrate calling contracts with tuple arrays (#1615)
  removed default meta tags in public/index.html
  fixed linting issue
  updated documentTitle component
  added metadata for pages (incomplete)
  fixed title comment-out
  removed react-document-title in favor of using react-helmet for consistency and bug fix
2019-02-21 16:45:00 -08:00
Fabio Berger
44e0b58c66 Fix migration exported types 2019-02-21 16:44:38 -08:00
Fabio Berger
3f7d5274a2 Fix version 2019-02-21 16:29:50 -08:00
Fabio Berger
c8f5f6045e Fix CI failures 2019-02-21 16:27:38 -08:00
F. Eugene Aumson
6bcc2064a2 Demonstrate calling contracts with tuple arrays (#1615) 2019-02-21 16:24:54 -08:00
Fabio Berger
3f9872d8b3 Remove getZeroExProvider method since it can be confusing 2019-02-21 16:07:23 -08:00
Fabio Berger
5814cd5fae Export supportedProvider in interface since this package is also used by external devs 2019-02-21 16:04:11 -08:00
Fabio Berger
44f8c7c548 Add TODO about consolidating type checks 2019-02-21 16:03:51 -08:00
Fabio Berger
c2549308fe Remove superfluous standardization 2019-02-21 16:00:44 -08:00
Fabio Berger
cf1a3bf4e7 Fix node types version in monorepo-scripts since it's used in test-installation and the latest version has a bug 2019-02-21 15:58:02 -08:00
fragosti
f5d668af31 Add radar_orderbook_usd_prices concept 2019-02-21 15:45:36 -08:00
Fabio Berger
b7bd4e5c51 Try fixing publish ci failure 2019-02-21 15:26:35 -08:00
fragosti
62373f969c Add concepts migrations 2019-02-21 12:51:27 -08:00
David Sun
ceb651fdd1 Merge pull request #1631 from dave4506/fix/website/remove-deplicate-meta-tags
Removed default meta tags in public/index.html
2019-02-21 10:43:40 -05:00
David Sun
8fa0f4a232 removed default meta tags in public/index.html 2019-02-21 10:20:29 -05:00
Fred Carlsen
30f2e3b606 Remove placeholder extensions 2019-02-21 13:49:35 +01:00
Fred Carlsen
7d3d997083 Merge remote-tracking branch 'upstream/development' into website-updates 2019-02-21 13:45:40 +01:00
Fred Carlsen
3955e2c84a Tweak padding 2019-02-21 13:43:47 +01:00
Fred Carlsen
6a6c41df26 Tweak extensions width 2019-02-21 13:42:03 +01:00
Fred Carlsen
1dfd2aec50 Tweak banner 2019-02-21 13:41:33 +01:00
askeluv
8885f543ae Pull exchange contract transactions from Etherscan 2019-02-21 20:37:55 +08:00
Fred Carlsen
8804e6c2ca Tweak banner 2019-02-21 11:17:01 +01:00
Fred Carlsen
88b7c214f7 Add extensions page 2019-02-21 11:16:52 +01:00
David Sun
297f3da5db Merge pull request #1626 from dave4506/fix/website/document-title-consistency-issue
Fix bug with document titles + add rich metadata for documents
2019-02-20 23:42:41 -05:00
David Sun
ec4d634677 fixed linting issue 2019-02-20 23:24:05 -05:00
David Sun
0ddec99704 updated documentTitle component 2019-02-20 23:08:04 -05:00
Fabio Berger
64cec1de3b Major version bump packages with modified exported type definitions 2019-02-20 18:07:01 -08:00
Fabio Berger
fdaf5d1fc8 Merge branch 'development' into supportEIP1193Providers
* development:
  Add constraint name to down phase as well
  Give the constraint an explicit name of token_orderbook_snapshots_pkey
  Remove comments
  Fix inconsistently named constraint
2019-02-20 18:01:23 -08:00
Fabio Berger
6baf71dca5 Make deprecation notice a warning message if used 2019-02-20 18:00:43 -08:00
Fabio Berger
9d75a72a02 Add back test 2019-02-20 17:59:53 -08:00
Francesco Agosti
4bf66d6a63 Merge pull request #1628 from 0xProject/fix/pipeline/fix-test-db-incorrectly-named-constraint
Fix inconsistently named constraint in migration
2019-02-20 17:17:16 -08:00
fragosti
8d9a550107 Add constraint name to down phase as well 2019-02-20 17:01:02 -08:00
fragosti
a076278026 Give the constraint an explicit name of token_orderbook_snapshots_pkey 2019-02-20 16:37:44 -08:00
fragosti
998dac44ee Remove comments 2019-02-20 16:09:33 -08:00
fragosti
871e81bd71 Fix inconsistently named constraint 2019-02-20 16:03:29 -08:00
Fabio Berger
d892d16b51 Merge branch 'development' into supportEIP1193Providers
* development: (37 commits)
  Factor out redundant source param in parse order functions
  Fix marquee typo
  Throw error if cannot find error in table
  Integrate one-time dump and API for nonfungible.com (#1603)
  Change optional text props to mandatory in LedgerSignNote
  Add radar_orders parseRadarOrder test
  Add parser test for Radar orderbook parsing
  Moved calculateSlippage from parsers to transformers
  Show greater than less than when minority has a vote
  Prettier
  Recieved -> Received
  Fix style for address table
  Hide ledger sign note on error
  Revert broken formatting
  Added ledger sign notification
  Fix bug in ledger address selector where provider does not exist.
  fix null column constraint issue
  Add parsing radar order test
  Rename migration to what it is called on prod and qa
  Fix type bug around Radar response
  ...
2019-02-20 14:52:58 -08:00
Fabio Berger
4cbf2781e5 Fix types so docs render 2019-02-20 14:31:40 -08:00
Fabio Berger
69653b1c7c Fix yarn.lock 2019-02-20 14:31:31 -08:00
Francesco Agosti
39390865da Merge pull request #1612 from 0xProject/feature/pipeline/add-radar
[pipeline] Add Radar orders and maker_address column to token_orderbook_snapshots
2019-02-20 14:17:42 -08:00
fragosti
4952cd5afb Factor out redundant source param in parse order functions 2019-02-20 13:45:14 -08:00
Fabio Berger
e86df96bfe Fix doc gen 2019-02-20 13:20:32 -08:00
fragosti
ef5195db90 Fix marquee typo 2019-02-20 11:43:32 -08:00
fragosti
bc7e62db9f Throw error if cannot find error in table 2019-02-20 11:40:49 -08:00
Fred Carlsen
9a7ccc20e8 Add new 404 page 2019-02-20 16:41:42 +01:00
Alex Svanevik
154e7a6a8a Merge pull request #1601 from askeluv/feature/pipeline/edps-slippage
Slippage calculations from Ethereum DEX Prices Service (EDPS)
2019-02-20 22:51:23 +08:00
Fabio Berger
ba56019f2d Add missing exported types 2019-02-19 23:59:12 -08:00
Fabio Berger
31d289c504 Add type import 2019-02-19 23:56:28 -08:00
Fabio Berger
a42b22966a Standardize bowser deps 2019-02-19 23:41:30 -08:00
Fabio Berger
17db62d463 Standardize web3-provider-engine deps 2019-02-19 23:40:45 -08:00
Fabio Berger
d6d40ea839 Improve commenty 2019-02-19 23:38:58 -08:00
Fabio Berger
eca8410dbb Update CHANGELOGs 2019-02-19 23:38:53 -08:00
Fabio Berger
eb3a530e6c Fix website build 2019-02-19 23:20:38 -08:00
Fabio Berger
26e17074c2 Fix linter issues 2019-02-19 23:09:26 -08:00
Fabio Berger
6b775628d5 Prettier fixes 2019-02-19 22:48:09 -08:00
Fabio Berger
13eb9103a7 Add back support for Web3@1.0-beta-37 and below 2019-02-19 22:48:02 -08:00
Fabio Berger
1fa82c1077 Fix up missing Provider interfaces and refactor providerUtils.standardizeOrThrow() 2019-02-19 22:34:31 -08:00
David Sun
426190181b added metadata for pages (incomplete) 2019-02-19 23:33:48 -05:00
F. Eugene Aumson
1232a9a03d Integrate one-time dump and API for nonfungible.com (#1603)
* Add script for pulling NFT trade data from nonfungible.com

* corrections for current state of API

* change data model to match data source

* change primary key

* pull data from initial dump first, then API

* pull all supported NFT's, not just cryptokitties

* disable problematic data sources

* rename function to satisfy linter

* Rename table to nonfungible_dot_com_trades

* rename parser module to nonfungible_dot_com from non_fungible_dot_com, for consistency

* correct mistaken reference to Bloxy

* rename NonfungibleDotComTrade to ...TradeResponse

* `NftTrade` -> `NonfungibleDotComTrade`

* rename files to match prior object renaming

* use fetchAsync instead of axios

* improve fetchAsync error message: include URL

* avoid non-null contraints in API trades too, not just for trades from the one-time dump

* disable mythereum publisher
2019-02-19 19:07:42 -08:00
Jacob Evans
e643c13292 Merge pull request #1622 from 0xProject/fix/governance-ledger-provider
[Governance] Ledger address selector ZRX balance
2019-02-19 17:52:42 -08:00
Jacob Evans
522736e367 Change optional text props to mandatory in LedgerSignNote 2019-02-19 17:34:06 -08:00
fragosti
12fd9c29f0 Add radar_orders parseRadarOrder test 2019-02-19 17:19:12 -08:00
fragosti
0c871b67ca Add parser test for Radar orderbook parsing 2019-02-19 16:58:11 -08:00
askeluv
379e828fc1 Moved calculateSlippage from parsers to transformers 2019-02-20 08:55:21 +08:00
Fabio Berger
fe1e8575ea Fix comments 2019-02-19 16:35:14 -08:00
Fabio Berger
8f14099adc Put all Web3.js provider interfaces next to eachother 2019-02-19 16:17:14 -08:00
Fabio Berger
852c1396ae Fix comments 2019-02-19 16:16:56 -08:00
Fabio Berger
b0f9195b57 merge development 2019-02-19 16:02:41 -08:00
Fabio Berger
98236736e0 Fix remaining Provider to SupportedProvider type 2019-02-19 15:25:47 -08:00
Jacob Evans
8b93a2816c Show greater than less than when minority has a vote 2019-02-19 14:53:18 -08:00
Leonid Logvinov
76d8a991c0 Merge pull request #1625 from 0xProject/feature/sol-compiler-offline
Sol-compiler offline mode
2019-02-19 14:21:09 -08:00
Leonid Logvinov
9186af1433 Fix a PR number 2019-02-19 14:20:13 -08:00
Alex Browne
6a473f4c57 Merge pull request #1617 from 0xProject/fix/devnet-readme-dockerhub
Update README for devnet
2019-02-19 13:47:46 -08:00
Alex Browne
42224ab534 Update README.md 2019-02-19 13:46:48 -08:00
Fabio Berger
20bcf09459 Modify providerUtils such that it simply guarentees a common sendAsync method but does not create a new instance since website depends on other properties being available 2019-02-19 13:25:57 -08:00
David Sun
5d1dd536e9 fixed title comment-out 2019-02-19 16:13:26 -05:00
David Sun
169b8807f7 removed react-document-title in favor of using react-helmet for consistency and bug fix 2019-02-19 16:10:35 -05:00
Jacob Evans
5acdab849e Prettier 2019-02-19 13:09:05 -08:00
Fabio Berger
2417084145 Rename public interface provider to supportedProvider and our internal provider to Provider 2019-02-19 12:47:01 -08:00
Jacob Evans
c16e62b5bf Recieved -> Received 2019-02-19 11:28:09 -08:00
Leonid Logvinov
6fa7d90f1f Define offlineMode as false in all smart contracts packages 2019-02-19 10:38:24 -08:00
Leonid Logvinov
1a3fd0227d Implement sol-compiler offline mode 2019-02-19 10:35:52 -08:00
Steve Klebanoff
2259b7dfcf Merge pull request #1624 from 0xProject/fix/instant-svg
[instant] Reset svg style
2019-02-19 10:08:47 -08:00
Steve Klebanoff
33fd70d0e1 reset svg because etherscan has a global svg style 2019-02-19 09:40:25 -08:00
Jacob Evans
fc906bcaae Governance tweaks 2019-02-19 09:23:28 -08:00
Jacob Evans
184e111e39 Fix style for address table 2019-02-19 09:12:29 -08:00
Fred Carlsen
ab62f50f5c Hide ledger sign note on error 2019-02-19 15:53:07 +01:00
Fred Carlsen
3eac854356 Revert broken formatting 2019-02-19 15:20:47 +01:00
Fred Carlsen
f7892cd86b Merge remote-tracking branch 'upstream/development' into governance-tweaks 2019-02-19 13:32:43 +01:00
Fred Carlsen
6e0260385c Added ledger sign notification 2019-02-19 13:32:25 +01:00
Jacob Evans
44300dabb0 Fix bug in ledger address selector where provider does not exist.
This can happen in browsers without metamask or a injected provider
2019-02-18 20:04:55 -08:00
David Sun
580c3038c8 Merge pull request #1621 from dave4506/fix/website/announcement-spacing
Added padding fix to announcements
2019-02-18 21:45:02 -05:00
David Sun
2a9175e964 added padding fix 2019-02-18 20:55:27 -05:00
Fabio Berger
5db20bbbe8 Add support for EIP1193 providers and clean up provider standardization logic 2019-02-18 15:12:29 -08:00
David Sun
ae144dff39 Merge pull request #1619 from dave4506/feature/website/add-banner-component
Adding announcement component for hero (for vote)
2019-02-18 09:13:57 -05:00
Jacob Evans
9f533efc92 Merge pull request #1620 from 0xProject/governance-vote-updates
Governance vote updates
2019-02-18 00:53:14 -08:00
Jacob Evans
76e15c4166 Yarn lock update 2019-02-18 00:41:36 -08:00
Jacob Evans
62bb2daf16 Add og-zeip23 for social sharing 2019-02-18 00:14:05 -08:00
Jacob Evans
59e292030a Update I voted badge svg 2019-02-18 00:08:55 -08:00
Jacob Evans
533fc7e444 Remove unused input 2019-02-17 23:31:02 -08:00
Jacob Evans
e5c5338eb6 Add governance to the footer 2019-02-17 23:29:47 -08:00
Jacob Evans
9463acb131 Update copy of Risk 2019-02-17 23:12:22 -08:00
Jacob Evans
e69749350b Update the formatting of ZRX (showing whole ZRX) 2019-02-17 23:09:45 -08:00
Jacob Evans
42749187ff Update copy on the banner 2019-02-17 22:51:42 -08:00
Jacob Evans
d5c2038d58 Update copy on the governance page 2019-02-17 22:24:38 -08:00
Jacob Evans
5843a61c9f Remove rounding (up) in total balance string 2019-02-17 22:16:56 -08:00
Jacob Evans
ecde2c9d7f Add todos for cleanup on duplicated code. Fix styling and typo 2019-02-17 21:53:25 -08:00
Jacob Evans
abd597c7a6 Update ZEIP from strings to numbers 2019-02-17 18:24:48 -08:00
Jacob Evans
b35e1d350b Remove unused 2019-02-17 13:26:27 -08:00
Jacob Evans
918399458d Submit the voting comment 2019-02-17 13:24:27 -08:00
Jacob Evans
72d9b7028b Handle Coinbase wallet inconsitency 2019-02-17 13:06:29 -08:00
Jacob Evans
ed9790c840 Vote: Added instant. Updated failure modes 2019-02-17 12:22:29 -08:00
Fred Carlsen
fd04bc4820 Fix linting errors 2019-02-17 12:22:29 -08:00
Fred Carlsen
58a213b7f9 Prevent overflowing content on error modal 2019-02-17 12:22:29 -08:00
Fred Carlsen
7f8bbfb4bd Fallback from EIP712 when signing 2019-02-17 12:22:29 -08:00
Fred Carlsen
8a3e64b3cd Update tally when user votes 2019-02-17 12:22:29 -08:00
Fred Carlsen
572de86d06 Add error modal 2019-02-17 12:22:28 -08:00
Fred Carlsen
88c33fa4d4 Add default color to icons 2019-02-17 12:22:28 -08:00
Jacob Evans
ee1c6a1ce1 Update copy
Co-Authored-By: sjelfull <fred@sjelfull.no>
2019-02-17 12:22:28 -08:00
Jacob Evans
09e90bea8b Update proposal title
Co-Authored-By: sjelfull <fred@sjelfull.no>
2019-02-17 12:22:28 -08:00
Fred Carlsen
bf758412c1 Import SignatureType from @0x/types 2019-02-17 12:22:28 -08:00
Fred Carlsen
0bbbf5b431 Fix no tally to prevent rounding 2019-02-17 12:22:27 -08:00
Fred Carlsen
87b2236cfb Cleanup 2019-02-17 12:22:27 -08:00
Fred Carlsen
855d2bb87f Add suffix to const name 2019-02-17 12:22:27 -08:00
Fred Carlsen
13b54a3b4d Remove Kovan prefix 2019-02-17 12:22:27 -08:00
Fred Carlsen
5d24ef4849 Remove web3 types 2019-02-17 12:22:27 -08:00
Fred Carlsen
b2da451e8d Tweak tabel formating of addres table 2019-02-17 12:22:27 -08:00
Fred Carlsen
139b66fa76 Format more links 2019-02-17 12:22:26 -08:00
Fred Carlsen
390ed5d7f1 Fix countdown and format in locale aware date 2019-02-17 12:22:26 -08:00
Fred Carlsen
16b5fb6b56 Fix countdown 2019-02-17 12:22:26 -08:00
Fred Carlsen
6205d6c885 Fix linting errors 2019-02-17 12:22:26 -08:00
Fred Carlsen
e5ea65da82 Cleanup unused parts 2019-02-17 12:22:12 -08:00
Fred Carlsen
9caa5feff5 Add derivation path change 2019-02-17 12:22:11 -08:00
Fred Carlsen
7f616356d2 Reset to voting screen when done 2019-02-17 12:21:40 -08:00
Fred Carlsen
155b5dd42f Tweak whitespace 2019-02-17 12:21:40 -08:00
Fred Carlsen
41aaf428bf Cleanup 2019-02-17 12:21:40 -08:00
Fred Carlsen
a17cdf33ea Fire onvoted callback 2019-02-17 12:21:39 -08:00
Fred Carlsen
3d5e879d5f Fix tally 2019-02-17 12:21:39 -08:00
Fred Carlsen
1a73ad3a32 Fix React errors on modal 2019-02-17 12:21:39 -08:00
Fred Carlsen
abb5e7cd39 Fix key on links 2019-02-17 12:21:39 -08:00
Fred Carlsen
cdae6de52e Lint 2019-02-17 12:21:39 -08:00
Fred Carlsen
910fe77ca3 Fix error 2019-02-17 12:21:39 -08:00
Fred Carlsen
b9a93c82d7 Linting fixes 2019-02-17 12:21:38 -08:00
Fred Carlsen
1c040bd616 Rename variable 2019-02-17 12:21:38 -08:00
Fred Carlsen
166c537938 Show balance on confirmation step 2019-02-17 12:21:38 -08:00
Fred Carlsen
79c8de5fd0 Update tally endpoint 2019-02-17 12:21:38 -08:00
Fred Carlsen
7e6d2102a5 Remove back button 2019-02-17 12:21:37 -08:00
Fred Carlsen
4f7d6132fc Remove python code 2019-02-17 12:21:37 -08:00
Fred Carlsen
b7fcc70cd9 Prettier + close button 2019-02-17 12:21:37 -08:00
Fred Carlsen
43ad27931c Update content base 2019-02-17 12:21:37 -08:00
Fred Carlsen
68dc3f75eb Use AWS endpoint when deployed 2019-02-17 12:21:37 -08:00
Fred Carlsen
e67eb6d5b4 Set strong to bold fontweight 2019-02-17 12:21:37 -08:00
Fred Carlsen
2e060bc85f Initial governance commit 2019-02-17 12:21:36 -08:00
Fred Carlsen
22f80e4b19 Fix type 2019-02-17 12:20:09 -08:00
Fred Carlsen
1ef434f95e WIP governance page 2019-02-17 12:20:08 -08:00
Tristan King
5676702da6 Add initial v0x backend and test frontend 2019-02-17 12:19:32 -08:00
David Sun
2fe0539600 added spacing + mobile changes 2019-02-16 22:34:50 -05:00
David Sun
13df5adecd added announcement component 2019-02-15 13:24:28 -05:00
fragosti
f33f808dc7 fix null column constraint issue 2019-02-14 17:17:35 -08:00
Francesco Agosti
82ed9ef25e Merge pull request #1618 from dave4506/bug/website/credit-leads-fix
Fix for credit lead form data
2019-02-14 17:15:23 -08:00
David Sun
0aa26d791d fix for credit lead form data 2019-02-14 20:14:37 -05:00
Alex Browne
255f278f5e Update README for devnet 2019-02-14 16:57:02 -08:00
Leonid Logvinov
1c76f9a0ff Merge pull request #1616 from 0xProject/feature/devnode-ws
Add WS endpoint to devnode
2019-02-15 01:47:29 +01:00
Leonid Logvinov
9a308e25a3 Add WS endpoint to devnode 2019-02-14 16:41:24 -08:00
David Sun
4b52f8c823 Merge pull request #1610 from dave4506/feature/website/infrastructure-deals
Infrastructure deals page
2019-02-14 18:21:09 -05:00
fragosti
8f7145f80a Add parsing radar order test 2019-02-14 15:07:09 -08:00
David Sun
eb17f053f7 Merged latest development to branch 2019-02-14 16:22:18 -05:00
David Sun
304e714331 changes to spacing 2019-02-14 16:02:39 -05:00
David Sun
525685f942 fixed code styling 2019-02-14 15:51:48 -05:00
David Sun
e2477b66c6 added polish to copy and mobile bugs 2019-02-14 15:36:58 -05:00
fragosti
58d51e039c Rename migration to what it is called on prod and qa 2019-02-14 10:45:48 -08:00
fragosti
cb5b5167fc Fix type bug around Radar response 2019-02-14 10:40:10 -08:00
fragosti
7d68378c3c Fix volume calculation bug 2019-02-14 09:40:38 -08:00
fragosti
87da6a947d Have migration to maker_address column working 2019-02-14 09:22:50 -08:00
askeluv
0e644da6ac Fixed linting issues 2019-02-14 17:39:12 +08:00
askeluv
d61a7c360e Self-hosted EDPS 2019-02-14 17:12:31 +08:00
askeluv
ab286d851d Changed Maps to EdpsWrappers 2019-02-14 15:30:58 +08:00
fragosti
e8b60ab292 Use remainingFillableAmount instead of maker/takerAssetAmount for amount field for Radar orders 2019-02-13 13:41:20 -08:00
fragosti
1cb7e70b42 increment MAX_PER_PAGE to 10000 2019-02-13 13:31:45 -08:00
Francesco Agosti
25b9c22845 Merge pull request #1614 from 0xProject/feature/website/faux-vote-page
Add vote placeholder page
2019-02-13 12:26:12 -08:00
fragosti
47166104fa run linter 2019-02-13 12:01:53 -08:00
fragosti
d0e0622058 PR feedback 2019-02-13 11:38:39 -08:00
fragosti
87c75a1e43 Add vote placeholder page 2019-02-13 11:25:18 -08:00
fragosti
d1cc08f1d9 Attempt to add maker_address token_orderbook_snapshots 2019-02-13 11:03:40 -08:00
David Sun
6619626486 changed dogfood s3 bucket and fixed linting issues 2019-02-13 12:14:13 -05:00
David Sun
1681ba090c changed check box 2019-02-13 11:35:05 -05:00
askeluv
c36e1ad056 Changes made as per comments - still have two minor things to fix 2019-02-13 20:23:07 +08:00
fragosti
d79c7f70be fix linting error 2019-02-12 14:58:05 -08:00
fragosti
b7eb2e4746 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/pipeline/add-radar 2019-02-12 14:56:02 -08:00
fragosti
4db9b8b0e3 Add script for pulling radar orderbook 2019-02-12 14:49:32 -08:00
fragosti
f3a537d5c2 Add radar parser 2019-02-12 14:35:50 -08:00
David Sun
6a704b8a77 Merge pull request #1611 from dave4506/feature/website/add-forum-link-footer
Added forum link
2019-02-12 17:32:25 -05:00
David Sun
df896877f8 added forum link 2019-02-12 17:24:57 -05:00
David Sun
3cb2d3dfff adding free credits page (incomplete) 2019-02-12 16:58:55 -05:00
fragosti
d5f5e79661 Add radar data source 2019-02-12 10:41:47 -08:00
askeluv
82dffe9d0e Added remaining tests + fixed linting issues 2019-02-12 19:34:05 +08:00
askeluv
d7825dd7db Added test for entity 2019-02-12 16:06:53 +08:00
askeluv
c0a2f429b6 Added saving to database 2019-02-12 12:30:10 +08:00
Fabio Berger
e909faa3ef Publish
- 0x.js@5.0.0
 - @0x/abi-gen@2.0.3
 - @0x/abi-gen-wrappers@3.0.3
 - @0x/assert@2.0.3
 - @0x/asset-buyer@5.0.4
 - @0x/base-contract@4.0.3
 - @0x/connect@4.0.4
 - @0x/contract-wrappers@7.1.0
 - @0x/contracts-gen@1.0.2
 - @0x/dev-tools-pages@0.0.19
 - @0x/dev-utils@2.1.0
 - @0x/fill-scenarios@2.0.4
 - @0x/instant@1.0.13
 - @0x/json-schemas@3.0.3
 - @0x/metacoin@0.0.40
 - @0x/migrations@3.0.4
 - @0x/monorepo-scripts@1.0.24
 - @0x/order-utils@6.1.0
 - @0x/order-watcher@3.0.4
 - @0x/pipeline@1.0.10
 - @0x/react-docs@2.0.4
 - @0x/react-shared@2.0.4
 - @0x/sol-compiler@3.0.3
 - @0x/sol-coverage@2.0.3
 - @0x/sol-doc@2.0.3
 - @0x/sol-profiler@2.0.4
 - @0x/sol-trace@2.0.4
 - @0x/sol-tracing-utils@6.0.3
 - @0x/sra-spec@2.0.3
 - @0x/subproviders@3.0.3
 - @0x/testnet-faucets@1.0.69
 - @0x/utils@4.1.0
 - @0x/web3-wrapper@5.0.0
 - @0x/website@0.0.72
 - @0x/contracts-asset-proxy@1.0.5
 - @0x/contracts-erc20@1.0.5
 - @0x/contracts-erc721@1.0.5
 - @0x/contracts-exchange@1.0.5
 - @0x/contracts-exchange-forwarder@1.0.5
 - @0x/contracts-exchange-libs@1.0.5
 - @0x/contracts-extensions@2.0.4
 - @0x/contracts-multisig@2.0.4
 - @0x/contracts-test-utils@3.0.4
 - @0x/contracts-utils@2.0.4
2019-02-09 18:44:40 +00:00
Fabio Berger
28d9fdf798 Updated CHANGELOGS 2019-02-09 18:44:28 +00:00
Fabio Berger
e9bfc44b90 Remove react deps from highlight 2019-02-09 17:28:52 +00:00
Fabio B
2a772b71f1 Merge pull request #1569 from 0xProject/feature/utils/decodeArbitrary0xCalldata
0x Transaction Data Decoder
2019-02-09 14:29:20 +00:00
Greg Hysen
233869ed80 updated changelog.json for 0x.js / order-utils / web3-wrapper 2019-02-08 17:12:58 -08:00
Greg Hysen
a9aaae7f97 Deduped random value generation from salt generation 2019-02-08 17:12:58 -08:00
Greg Hysen
500b4940a3 Improvements and conventions in utils package + abi decoder 2019-02-08 17:12:54 -08:00
Greg Hysen
6d0dc47157 updated changelog for contract wrappers 2019-02-08 16:25:30 -08:00
Greg Hysen
56e7e7d644 updated exports for contract wrappers 2019-02-08 16:25:30 -08:00
Greg Hysen
93c128ee21 Added exports for doc generation 2019-02-08 16:25:30 -08:00
Greg Hysen
c72e3667b8 ran prettier and linter 2019-02-08 16:25:30 -08:00
Greg Hysen
6406126ae3 Merged tx decoder into AbiDecoder in utils and merged zeroex tx decoder into ContractWrappers. 2019-02-08 16:25:30 -08:00
Greg Hysen
6bde77bb57 fix doc generation in contract-wrappers 2019-02-08 16:25:30 -08:00
Greg Hysen
831a628379 ran linter 2019-02-08 16:25:30 -08:00
Greg Hysen
3d2babd059 Tests for transaction decoder 2019-02-08 16:25:30 -08:00
Greg Hysen
d9c4c74a56 Added tests for ZeroExTransactionDecoder 2019-02-08 16:25:30 -08:00
Greg Hysen
5a231fb057 Prep for txData decoder tests 2019-02-08 16:25:30 -08:00
Greg Hysen
63f41df327 started writing tests for zeroex tx decoder 2019-02-08 16:25:30 -08:00
Greg Hysen
171618d32b Added comments for transaction decoder 2019-02-08 16:25:30 -08:00
Greg Hysen
f7b58e7f64 moved ZeroExTransactionDecoder into contract wrappers 2019-02-08 16:25:30 -08:00
Greg Hysen
436d87da98 Ran prettier and linter 2019-02-08 16:25:30 -08:00
Greg Hysen
896874fb99 separated tx decode classes and types into separate files 2019-02-08 16:25:30 -08:00
Greg Hysen
a9f8e80b1c Abstractd out ZeroExTransactionDecoder 2019-02-08 16:25:30 -08:00
Greg Hysen
f93cd1bb48 Can query decoder by contract address / network id OR contract name 2019-02-08 16:25:30 -08:00
Greg Hysen
8fc3a6b828 Expanding search parameters for transaction decoder 2019-02-08 16:25:30 -08:00
Greg Hysen
100840b743 Utility function to decode arbitrary 0x calldata 2019-02-08 16:25:30 -08:00
David Sun
8c8cab9309 added page [WIP] still 2019-02-08 18:06:58 -05:00
F. Eugene Aumson
629a8d6328 Add migration to fix exchange events primary keys (#1593)
* Add migration to fix exchange events primary key

* correct comment: "foreign key" -> "primary key"

* Refine hack to handle only the expected error

* Add tx hash to erc20 approval events primary key
2019-02-08 13:21:41 -05:00
Fabio B
ffdaec9f9f Merge pull request #1602 from 0xProject/feat/allow_using_existing_ganache_snapshot
Allow using Web3Factory in-process Ganache with existing snapshot
2019-02-08 17:49:33 +00:00
Fabio Berger
c794153221 Add CHANGELOG entry 2019-02-08 13:22:11 +00:00
Fabio Berger
d01837f42c Allow using Web3Factory in-process Ganache with existing snapshot 2019-02-08 13:19:47 +00:00
askeluv
7ad4cb0078 [WIP] Slippage calculations from Ethereum DEX Prices Service (EDPS) 2019-02-08 18:54:38 +08:00
David Sun
ffd8349889 Merge pull request #1581 from dave4506/feature/instant/bignumber-coerce-type
Big number input to Instant coercion to version utilized by 0x packages
2019-02-07 21:06:43 -05:00
David Sun
f3716fd813 fixed config orderSource assignment 2019-02-07 20:41:37 -05:00
Greg Hysen
1170cf1896 Merge pull request #1592 from 0xProject/feature/abiEncoder/simplifiedSigParsing
Simplified signature parsing + signature tests
2019-02-07 15:18:37 -08:00
Greg Hysen
b9ee9d2bd5 replaced typeof with _.isString 2019-02-07 15:01:29 -08:00
Greg Hysen
21c3f75efc Changelog for utils package 2019-02-07 15:01:29 -08:00
Greg Hysen
eb5f7e36e9 Signature parsing tests 2019-02-07 15:00:07 -08:00
Greg Hysen
4079563f5d More robust/simple signature parsing, using a parse tree 2019-02-07 15:00:07 -08:00
David Sun
6dabed5938 updated order coercion utils architecture and testing 2019-02-07 16:45:56 -05:00
Fabio B
3939d516e6 Merge pull request #1586 from 0xProject/addAnalyticsToDevToolsPages
Add Heap and Google analytics to Dev Tools Pages
2019-02-07 21:18:41 +00:00
Fabio Berger
5aba9d698b Only include analytics on production builds 2019-02-07 14:54:12 +00:00
Fabio Berger
3dd652e7cf Merge branch 'development' into addAnalyticsToDevToolsPages
* development: (51 commits)
  Publish
  Updated CHANGELOGS
  Updated CHANGELOGS
  Update packages/sol-compiler/CHANGELOG.json
  Update packages/sol-compiler/CHANGELOG.json
  Move from devDep to dep
  Fix linter
  Update CHANGELOG
  Re-run yarn since fails again on first run
  Add PR numbers
  Omit remapping in compiler settings equality checks
  Omit remapping in compiler settings equality checks
  Fix a bug when ast and legacyAST were not present in the artifacts even if requested
  Update yarn.lock
  Remove the bin_paths and fetch the solidity release list from github repo
  Remove postinstall hack
  Fix the undefined opts bug
  Fix sol-compiler bug with remappings causing smart recompilation to now work
  re-add postinstall hack
  Fix deps versions
  ...
2019-02-07 14:28:24 +00:00
Leonid Logvinov
f003298ce4 Publish
- 0x.js@4.0.3
 - @0x/abi-gen@2.0.2
 - @0x/abi-gen-wrappers@3.0.2
 - @0x/assert@2.0.2
 - @0x/asset-buyer@5.0.3
 - @0x/base-contract@4.0.2
 - @0x/connect@4.0.3
 - @0x/contract-wrappers@7.0.2
 - @0x/contracts-gen@1.0.1
 - @0x/dev-tools-pages@0.0.18
 - @0x/dev-utils@2.0.2
 - @0x/fill-scenarios@2.0.3
 - @0x/instant@1.0.12
 - @0x/json-schemas@3.0.2
 - @0x/metacoin@0.0.39
 - @0x/migrations@3.0.3
 - @0x/monorepo-scripts@1.0.23
 - @0x/order-utils@6.0.1
 - @0x/order-watcher@3.0.3
 - @0x/pipeline@1.0.9
 - @0x/react-docs@2.0.3
 - @0x/react-shared@2.0.3
 - @0x/sol-compiler@3.0.2
 - @0x/sol-coverage@2.0.2
 - @0x/sol-doc@2.0.2
 - @0x/sol-profiler@2.0.3
 - @0x/sol-resolver@2.0.2
 - @0x/sol-trace@2.0.3
 - @0x/sol-tracing-utils@6.0.2
 - @0x/sra-spec@2.0.2
 - @0x/subproviders@3.0.2
 - @0x/testnet-faucets@1.0.68
 - @0x/types@2.0.2
 - @0x/utils@4.0.3
 - @0x/web3-wrapper@4.0.2
 - @0x/website@0.0.71
 - @0x/contracts-asset-proxy@1.0.4
 - @0x/contracts-erc20@1.0.4
 - @0x/contracts-erc721@1.0.4
 - @0x/contracts-exchange@1.0.4
 - @0x/contracts-exchange-forwarder@1.0.4
 - @0x/contracts-exchange-libs@1.0.4
 - @0x/contracts-extensions@2.0.3
 - @0x/contracts-multisig@2.0.3
 - @0x/contracts-test-utils@3.0.3
 - @0x/contracts-utils@2.0.3
2019-02-07 15:02:05 +01:00
Leonid Logvinov
5f5ee0041f Updated CHANGELOGS 2019-02-07 15:01:53 +01:00
Leonid Logvinov
88497ddc52 Updated CHANGELOGS 2019-02-07 14:42:20 +01:00
Fabio B
e921d5ec13 Merge pull request #1589 from 0xProject/feat/lock-contract-deps
Lock dep versions in contracts packages (again)
2019-02-07 13:28:57 +00:00
Leonid Logvinov
c55974a485 Merge pull request #1596 from 0xProject/fix/sol-compiler-args
Sol-compiler bug fixes
2019-02-07 14:18:55 +01:00
Fabio B
2ff0f545f5 Update packages/sol-compiler/CHANGELOG.json
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-02-07 14:17:41 +01:00
Fabio B
7f2a011c3e Update packages/sol-compiler/CHANGELOG.json
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-02-07 14:17:23 +01:00
Fabio Berger
8af9a38c8e Move from devDep to dep 2019-02-07 13:07:36 +00:00
Leonid Logvinov
b54bafe1c5 Fix linter 2019-02-07 13:35:50 +01:00
Fabio Berger
7a9ff3846e Merge development 2019-02-07 12:33:44 +00:00
Leonid Logvinov
53fe08a348 Update CHANGELOG 2019-02-07 13:30:00 +01:00
Fabio Berger
f118e86cfe Re-run yarn since fails again on first run 2019-02-07 12:29:05 +00:00
Leonid Logvinov
2e60d5341e Add PR numbers 2019-02-07 13:24:57 +01:00
Leonid Logvinov
2ef3af0003 Omit remapping in compiler settings equality checks 2019-02-07 13:20:21 +01:00
Leonid Logvinov
2b7699c26a Omit remapping in compiler settings equality checks 2019-02-07 13:20:03 +01:00
Leonid Logvinov
d567c58d3b Fix a bug when ast and legacyAST were not present in the artifacts even if requested 2019-02-07 13:10:08 +01:00
Fabio Berger
bede3d7e29 Update yarn.lock 2019-02-07 12:01:57 +00:00
Leonid Logvinov
64d6dae672 Remove the bin_paths and fetch the solidity release list from github repo 2019-02-07 12:58:46 +01:00
Fabio Berger
b001fe2b08 Remove postinstall hack 2019-02-07 11:58:06 +00:00
Leonid Logvinov
c20285dd36 Fix the undefined opts bug 2019-02-07 12:30:54 +01:00
Leonid Logvinov
7e19c944b9 Merge pull request #1575 from 0xProject/feature/contracts-gen
Contracts generator
2019-02-07 12:23:00 +01:00
Leonid Logvinov
fd4d3cff88 Fix sol-compiler bug with remappings causing smart recompilation to now work 2019-02-07 12:13:24 +01:00
Fabio Berger
5ff646ca8e re-add postinstall hack 2019-02-07 10:53:14 +00:00
Leonid Logvinov
88432a5e67 Fix deps versions 2019-02-07 11:49:59 +01:00
Leonid Logvinov
7519d60fb7 Fix linter issues 2019-02-07 11:29:04 +01:00
Leonid Logvinov
de23428069 Merge development 2019-02-07 11:15:37 +01:00
Amir Bandeali
9089bf2c5f Lock dep versions in contracts packages 2019-02-06 21:10:35 -08:00
Fabio Berger
2a344e26cc Publish
- 0x.js@4.0.2
 - @0x/asset-buyer@5.0.2
 - @0x/connect@4.0.2
 - @0x/contract-wrappers@7.0.1
 - @0x/dev-tools-pages@0.0.17
 - @0x/fill-scenarios@2.0.2
 - @0x/instant@1.0.11
 - @0x/migrations@3.0.2
 - @0x/monorepo-scripts@1.0.22
 - @0x/order-utils@6.0.0
 - @0x/order-watcher@3.0.2
 - @0x/pipeline@1.0.8
 - @0x/react-docs@2.0.2
 - @0x/react-shared@2.0.2
 - @0x/testnet-faucets@1.0.67
 - @0x/website@0.0.70
 - @0x/contracts-asset-proxy@1.0.3
 - @0x/contracts-erc20@1.0.3
 - @0x/contracts-erc721@1.0.3
 - @0x/contracts-exchange@1.0.3
 - @0x/contracts-exchange-forwarder@1.0.3
 - @0x/contracts-exchange-libs@1.0.3
 - @0x/contracts-extensions@2.0.2
 - @0x/contracts-multisig@2.0.2
 - @0x/contracts-test-utils@3.0.2
 - @0x/contracts-utils@2.0.2
2019-02-07 01:53:15 +00:00
Fabio Berger
af26403a86 Updated CHANGELOGS 2019-02-07 01:53:02 +00:00
Fabio B
3af6c8fe1d Merge pull request #1595 from 0xProject/fix-order-utils-doc-rendering
Stop exporting EIP712 schemas
2019-02-07 01:24:32 +00:00
Fabio Berger
b883b183a6 Stop exporting EIP712 schemas 2019-02-07 01:03:43 +00:00
Fabio Berger
ac58ace8cf Add CHANGELOG entry about faux publish of contract packages 2019-02-07 00:16:39 +00:00
Fabio Berger
a50eefc44e Fix paragraph rendering on wiki 2019-02-06 14:08:45 +00:00
David Sun
d95af455f1 added coercion util functions 2019-02-05 16:46:51 -05:00
Fabio Berger
8de955f3d8 Add Heap and Google analytics to Dev Tools Pages 2019-02-05 21:34:29 +00:00
David Sun
59f48d6d57 working on big number coercion function 2019-02-04 11:19:18 -05:00
Leonid Logvinov
4d75681357 Add @0x/types dependency 2019-02-04 13:11:20 +01:00
Leonid Logvinov
1a88eac9c7 Make the banner more visible 2019-02-04 13:00:15 +01:00
Leonid Logvinov
47357ddec8 Remove redundant dependencies 2019-02-04 12:58:19 +01:00
Fabio B
129ae3a737 Update packages/contracts-gen/src/index.ts
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-02-04 12:56:18 +01:00
Fabio B
31d1390039 Update packages/contracts-gen/README.md
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-02-04 12:52:36 +01:00
Leonid Logvinov
6943bbcacb Temp 2019-02-04 10:38:02 +01:00
MarcZenn
1bff790628 removed implicit cached accounts dependency 2019-01-14 11:03:33 -08:00
MarcZenn
0010ca3e03 updated error msg 2018-12-31 11:21:47 -08:00
MarcZenn
9edb5dae88 passing network id to constructor 2018-12-31 11:12:25 -08:00
MarcZenn
85b49096dc first requested changes 2018-12-31 11:04:19 -08:00
MarcZenn
a7eaa10220 remove trezor-connect module 2018-12-12 19:05:23 -08:00
MarcZenn
5a46ce55b6 prettier again 2018-12-12 18:32:30 -08:00
MarcZenn
dbebbecab1 restore CI builds 2018-12-12 18:20:30 -08:00
MarcZenn
c7593e66bf ran prettier 2018-12-12 15:02:41 -08:00
MarcZenn
d52dc69279 init trezor subprovider w/ trezor connect client api 2018-12-12 14:42:36 -08:00
MarcZenn
1c65fa212d restore unit tests 2018-12-11 16:59:25 -08:00
MarcZenn
be88eb00f8 clean up 2018-12-07 10:02:35 -08:00
marcmartinez
65c60f5386 [WIP] trezor subprovider 2018-12-07 07:06:40 -08:00
Fabio Berger
83a043e639 Merge branch 'development'
* development: (81 commits)
  Publish
  Updated CHANGELOGS
  print out error message and stack
  immediately return the patch incremented version if no changelog entries exist
  Put python package above TS/JS packages
  Reduce title size
  reduce text side in README
  Improve top-level README
  Fix prettier
  remove unused flag
  Add CHANGELOG entry
  Fix additional comments
  Improve comments
  Add migrations, contract-addresses and contract-artifacts to Developers home
  Create migrations doc reference page
  Add additional CHANGELOG to types package
  Add CHANGELOG entry
  Fix prettier
  Fix `SimpleContractArtifact` type
  Update abi-gen-wrappers
  ...
2018-11-21 21:19:31 +00:00
Fabio Berger
8175192f60 Merge branch 'development'
* development: (957 commits)
  fix(order_utils.py): publish docs to S3, not RTD (#1264)
  fix: make instant package private
  feat: refer to map file in postpublish configs
  feat: add new bundle name to bundle watch
  fix: tslint ignore rule in wrong place
  Update blog post feature
  Fix disclaimer on mobile
  Add smart contract docs to Developer Home
  Add Apache license link
  Fix capitalization in title
  Remove excess semi-colon
  Point directly to README for docs link
  Update icons
  Update LICENSE
  Fix disclaimer
  Add blogpost URL
  Add disclaimer
  Add launch kit to Developer home list of tools
  feat: Deploy contracts to Rinkeby
  fix: fix exceeds block gas limit error
  ...
2018-11-19 12:49:16 +00:00
Leonid Logvinov
7d2c975d73 Merge branch 'development' 2018-10-09 13:13:10 +02:00
Brandon Millman
e5153737d8 Merge branch 'development'
* development: (939 commits)
  Add asset-buyer to published packages section in README
  Publish
  Updated CHANGELOGS
  Update BuyQuote interface
  force re-build
  Add website build to instructions
  Revert format and re-add changes
  Build website in parallel with other tests since no other test relies on it being built to run
  Add back sourceMap support for both dev/prod
  Upgrade webpack
  Add missing default options
  Remove unused constants
  Add fee order with a takerFee
  Add additional order factory methods and refactor test to use them
  Add comments about buy quote calculation
  Update CHANGELOG
  Fix linter
  Add additional test for slippage
  Add buy_quote_calculator_test
  Add 0x Instant to bundle analysis
  ...
2018-10-04 16:06:05 -07:00
Alex Browne
88766a02c7 Merge branch 'development' 2018-08-13 18:42:09 -07:00
Fabio Berger
8162394797 Merge branch 'development'
* development: (175 commits)
  small README fixes
  Update docs list in README
  Add manual postpublish command to all public packages and update CHANGELOG.json
  Fix postpublish util to ignore namespace
  Fix release notes bug
  Should print out `lerna publish` stdout so we can see if anything went wrong
  Publish
  Updated CHANGELOGS
  Generate CHANGELOG.json files
  Fix hasty find/replace
  Default to 4sp
  Update moment, no longer need separate moment types
  Move prettify command to utils and also call it on CHANGELOG.md
  Add prettier run on generated CHANGELOG.json and fix scripts
  Remove semi-colons from monorepo-scripts package.json
  Get rid of ; in top-level package.json
  Fix TSLint error
  Make dry-run configurable from top-level package.json
  Improve naming
  Run prettier, update deployer CHANGELOG
  ...
2018-04-02 21:23:07 +09:00
Fabio Berger
fd001186dd Merge branch 'development'
* development:
  Update deployer version since manual re-publish
  Add new entry into CHANGELOG
  Fix bad merge
  Update yarn.lock
  Change title
  Add Blake and Zach to About page
  Re-size Jacob and Tom's images
  WIP
  Fix bad merge
  Fix yarn.lock
  Fix quotation marks
  Update README and CHANGELOG
  Add scaffolding for sra-report collection unit tests
2018-03-20 11:11:07 +00:00
Fabio Berger
128fef8838 Merge branch 'master' of github.com:0xProject/0x-monorepo
* 'master' of github.com:0xProject/0x-monorepo:
2018-03-19 01:18:01 +01:00
Fabio Berger
1e25a0654a Merge branch 'development'
* development:
  Manually publish 0x.js back to a working state
  Publish
  Publish
  Fix 0x.js assets
  Remove assets from connect and _bundles from packages that don't generate the folder
  Publish
  Fix packages that aren't working as expected
2018-03-19 01:17:37 +01:00
Fabio Berger
82b0ff6008 Merge branch 'development'
* development: (269 commits)
  Make new packages default to public on publish
  Add new public packages to top-level README
  Update top-level package.json
  Fix incorrect new versions
  Fix path to assets
  Publish
  Updated CHANGELOGS
  Fix quotation marks
  Add a complex test for ast visitor
  Move opcodes to constants
  Fix issue with bundling subproviders for the browser by ignoring the `ganache-core` dependency
  Add changelog entry about pragma addition
  Add pragma above command-line script
  Add tests for sol-cov
  Updated CHANGELOGs
  Add SignedOrder, Order, and ECSignature types to the types package
  Keep console.log in monorepo-scripts
  Enable coverage for all other packages with tests
  Fix parallel coverage results reporting
  Fix linter issuesx
  ...
2018-03-18 20:14:02 +01:00
Brandon Millman
ca7c3630f9 Merge branch 'development'
* development: (114 commits)
  Prettier sra-report README
  Add new packages to top level README
  Updated @0xproject/utils in top level package.json
  Publish
  Updated CHANGELOGs
  Detail tests in the README
  Add support for ropsten and rinkeby
  Fix yarn.lock
  Update list of packages and organize them alphabetically
  Fix prettier issues
  Add support for going back to previous hashes via the browser back button to wiki
  Scroll to previous hashed elements when user clicks back button
  Add back strict null checks to react-shared package and fix issues
  remove ability to have implicit dependencies and add missing deps
  update license
  remove no-implicit-this
  Add example & screenshot to npmignore
  Remove `;` to be nice to windows users
  Use unencoded @ symbol, browser will fix
  Fix external type links
  ...
2018-03-08 10:47:23 -08:00
Brandon Millman
260bb8218f Merge branch 'master' of github.com:0xProject/0x-monorepo
* 'master' of github.com:0xProject/0x-monorepo: (171 commits)
  Fix bugs in postpublish_utils.js
  Update @0xproject/utils in top-level package.json
  Changelog tweaks
  Publish
  Updated CHANGELOGS
  Fix typo
  Add PR number to changelog entry
  Add changelog update to subproviders package
  Add `numberOfAccounts` param to `LedgerSubprovider` method `getAccountsAsync` and add tests
  Remove unnecessary type assertion
  Fix comments
  Add comments
  Don't need any external packages for 0x connect docs yet
  Instead of adding `@0xproject/types` to tsconfig.json, let's only add it when calling TypeDoc
  Fix styling
  Make prettier ignore postpublish_utils
  Update yarn.lock
  Update yarn.lock
  Update all mentions of the repo name being `0x.js` to `0x-monorepo`
  Add hack comment
  ...
2018-03-08 10:47:13 -08:00
Fabio Berger
a691de7d55 Merge branch 'development'
* development:
  Fix bugs in postpublish_utils.js
2018-03-05 06:13:18 +01:00
Fabio Berger
5674c484e2 Merge branch 'development'
* development: (175 commits)
  Update @0xproject/utils in top-level package.json
  Changelog tweaks
  Publish
  Updated CHANGELOGS
  Fix typo
  Add PR number to changelog entry
  Add changelog update to subproviders package
  Add `numberOfAccounts` param to `LedgerSubprovider` method `getAccountsAsync` and add tests
  Remove unnecessary type assertion
  Fix comments
  Add comments
  Don't need any external packages for 0x connect docs yet
  Instead of adding `@0xproject/types` to tsconfig.json, let's only add it when calling TypeDoc
  Fix styling
  Make prettier ignore postpublish_utils
  Update yarn.lock
  Update yarn.lock
  Update all mentions of the repo name being `0x.js` to `0x-monorepo`
  Add hack comment
  Add comment about typeDoc versions
  ...
2018-03-04 19:38:55 +01:00
Brandon Millman
9286dc284c Merge branch 'development'
* development:
  Publish
  Updated CHANGELOGs
  Do not JSON parse empty reponse
  Fix incorrect comment on WebSocketOrderbookChannel constructor
  Fix broken postpublish script in connect
2018-02-16 23:00:54 -07:00
Brandon Millman
624b71bd39 Merge branch 'development'
* development: (45 commits)
  Updated top level @0xproject/utils dependency
  Publish
  Updated CHANGELOGs
  Add an enforced minimum for the heartbeat interval
  Add Rinkeby network to smart contract docs
  Updated CHANGELOG
  Add configurable heartbeat to WebSocketOrderbookChannel
  remove hard-coded color
  Remove section links until they go somewhere
  Add more padding on top of section title
  Add hack comment explaining param count short-cut
  replace repeated conditionals with variable
  Remove unneeded props
  use const over hard-coding
  uncomment dev logic
  Re-design docs pages
  Add icons for all doc pages
  Re-designed Wiki and half-redesigned docs pages
  Prettier fixes
  Rename variables
  ...
2018-02-16 10:01:01 -07:00
Fabio Berger
b7ea605a3b Merge branch 'development'
* development: (57 commits)
  Update utils in top-level package.json
  Publish
  Fix version in CHANGELOG
  Update changelog version
  Fix changelog version
  Fix changelogs
  Add `yarn-error.log` to all .npmignore
  Add PR number to CHANGELOGs
  ignore all files starting with dots in all sub-packages
  Remove top level .npmignore
  Add npmignore to web3-wrapper and update CHANGELOG
  Add npmignore and remove .gitignore
  Add npmignore to utils and update CHANGELOG
  Add npmignore to types and update CHANGELOG
  cleanup npmignorex
  Add npmignore to subproviders and update CHANGELOG
  Add npmignore to json-schemas and update CHANGELOG
  Add npmignore to dev-utils and update CHANGELOG
  Add npmignore to deployer along with a changelog
  Add tslint.json to deployer package and fix all tslint issues
  ...
2018-02-09 16:36:13 -08:00
Brandon Millman
489a787de8 Merge branch 'development'
* development: (199 commits)
  Update @0xproject/utils version in top level package.json
  Publish
  Update CHANGELOGs
  Fix wiki styling
  Prettier
  Addressed review comments
  Update Subprovider README
  Fix Remco's github name in CODEOWNERS
  Only show faucet error if not on a testnet
  Organize async task queues by network
  Fix ABI error message
  Move isTestNetwork into utils and also check it from showing ZRX request button
  Stop using definite assignment assertion cause prettier doesn't handle that
  Special-case ZRXToken snake case conversion
  Fix linter errors
  Generate contract wrappers on pre-build
  Add missing async
  Remove noImplicitThis
  Tslint disable no-consecutive-blank-lines in generated files
  Change compiled sources in contracts
  ...
2018-02-07 13:37:53 -08:00
Fabio Berger
84150036ed Merge branch 'development'
* development: (78 commits)
  Publish
  Add PR number
  Add config file specifically in prettier command and fix files
  Fix prettier
  Fix prettier
  Add shouldAddPersonalMessagePrefix param to signOrderHashAsync instead of trying to infer whether to add it or not from the nodeVersion
  Publish
  Move @0xproject/types to dependencies
  Updated web3-typescript-typings changelog
  Fixed getTransactionReceipt not returning null
  Run prettier
  Update changelog
  Add Rinkeby addresses to artifacts
  Fix bad merge on package.json
  Respond to GH comments and add /info endpoint
  Publish
  Update yarn.lock
  Update the CHANGELOG
  Fix the bug making it impossible to specify the custom ZRX address
  Change package name to @0xproject/testnet-faucets
  ...
2018-01-30 13:59:47 +01:00
Brandon Millman
619123720c Merge branch 'development'
* development: (31 commits)
  Publish
  Update CHANGELOG
  Fix the typos
  Added PR number to web3 typings changelog
  Update the CHANGELOG
  Fix fillOrdersUpTo balances validation
  Add a regression test for fillUpToValidation
  Fix web3 typing defaultAccount not allowing `undefined`
  Sort packages alphabetically in README
  Add postpublish scripts
  Return after checking for an error and add an explanatory comment
  Stop appending /v0 to HttpClient api endpoint urls
  Add chai-as-promised-typescript-typings
  Remove redundant type refs
  Improve HttpClient errors
  Add web3-typescript-typings and chai-as-promised-typescript-typings to the main monorepo
  Import chai-as-promised-typescript-typings
  Fix @bmilman linkedin link
  Add new team photos
  Add a CHANGELOG to a website
  ...
2018-01-17 22:49:31 -08:00
Leonid Logvinov
cc98ff9fe6 Merge branch 'development' 2018-01-11 13:17:12 +01:00
Leonid Logvinov
39d159f38c Merge branch 'development' 2017-12-20 17:25:03 +01:00
Leonid Logvinov
ca8eb90cec Merge branch 'development' 2017-12-15 16:07:05 +01:00
Leonid Logvinov
f8e3e28d85 Merge branch 'development' 2017-12-14 17:52:23 +01:00
Leonid Logvinov
4d868489bd Merge branch 'development' 2017-12-13 16:06:31 +01:00
Brandon Millman
b06f09f6af Merge branch 'development'
* development: (115 commits)
  Publish
  Add scope to abi-gen dependency in 0x.js
  Add @0xproject scope to abi-gen package name
  Add yarn install to lerna:publish command
  Make contracts package private
  Update connect changelog
  remove console.log
  Update README.md
  Fix unit test
  Add missing params
  Debug CircleCi failure
  Update yarn.lock
  Inline network module
  Add todo
  Stop supporting different file extensions in abi-gen
  Refactor networkId out of web3Wrapper
  Update connect types in preperation for publishing
  Add link to random id generator
  Remove `prebuild` command and add `test:circleci`
  Make sure we don't pass empty maker into getOrderHashHex
  ...
2017-12-08 14:21:59 -08:00
Brandon Millman
bf00f5f945 Merge branch 'development'
* development: (156 commits)
  Publish
  Update CHANGELOG.md
  Redeclare Order, SignedOrder, and ECSignature types in connect, remove 0x.js dependency
  Add SignedOrder and TokenTradeInfo to public interface and fix a HttpClient comment
  Add TokenTradeInfo to public types
  Rename @0xproject/connect to 0x Connect
  Rename packageName to displayName for clarity
  Fix phantom `Contracts` section issue
  Add 0x Connect to footer
  Update 0x.js to 0.27.1
  Fix connect documentation introduction and installation wording
  Lock the 0x.js version used in website
  rename for clarity
  remove unused code
  Add 0x Connect Docs to the menu and topBar
  Add connect docs
  Add subPackageName and get rid of hard-coded 0x.js in sourceLink
  Publish
  Refactor the topLevel documentation react components for 0x.js and Smart contracts into a single component
  Export TransactionOpts type
  ...
2017-11-29 12:55:34 -08:00
Brandon Millman
6ceb6cc301 Merge branch 'development'
* development: (143 commits)
  Fix connect CHANGELOG version
  Publish
  Fix npm auth issues
  Revert "Publish"
  Publish
  Add actual version to CHANGELOG
  Add blockchainLifecycle management to the ExpirationWatcher test
  Update connect CHANGELOG.md in preperation for publishing
  Add TODO comment before BigNumber.config() call
  Prepare connect package for publishing
  Last renames
  Refactor while condition
  Fix tests
  Fix a typo in  postpublish utils tags -> tag
  Publish
  Revert "Publish"
  Publish
  Add instanceOf assertion
  Rename toDecimal to hexToDecimal
  Add PR numbers
  ...
2017-11-22 15:23:27 -08:00
Fabio Berger
00a6afaa8e Re-add changelog for 0x.js 2017-11-13 16:27:43 -05:00
1938 changed files with 247877 additions and 55091 deletions

View File

@@ -4,19 +4,29 @@ 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
# 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: sudo npm install --global yarn@1.9.4
command: npm install --global yarn@1.17.0
- run:
name: yarn
command: yarn --frozen-lockfile --ignore-engines install
command: yarn --frozen-lockfile --ignore-engines install || yarn --frozen-lockfile --ignore-engines install
- setup_remote_docker
- run: yarn build:ci:no_website
- run: yarn build:ts
@@ -24,10 +34,14 @@ jobs:
key: repo-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo
- 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:
@@ -35,25 +49,18 @@ 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:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn wsrun test:circleci @0x/contracts-multisig
- run: yarn wsrun test:circleci @0x/contracts-utils
- run: yarn wsrun test:circleci @0x/contracts-exchange-libs
- run: yarn wsrun test:circleci @0x/contracts-erc20
- run: yarn wsrun test:circleci @0x/contracts-erc721
- run: yarn wsrun test:circleci @0x/contracts-extensions
- run: yarn wsrun test:circleci @0x/contracts-asset-proxy
- run: yarn wsrun test:circleci @0x/contracts-exchange
- run: yarn wsrun test:circleci @0x/contracts-exchange-forwarder
- 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:
@@ -62,19 +69,11 @@ jobs:
- repo-{{ .Environment.CIRCLE_SHA1 }}
# HACK(albrow): we need to sleep 10 seconds to ensure the devnet is
# initialized
- run: sleep 10 && TEST_PROVIDER=geth yarn wsrun test @0x/contracts-multisig
- run: TEST_PROVIDER=geth yarn wsrun test:circleci @0x/contracts-utils
- run: TEST_PROVIDER=geth yarn wsrun test:circleci @0x/contracts-exchange-libs
- run: TEST_PROVIDER=geth yarn wsrun test:circleci @0x/contracts-erc20
- run: TEST_PROVIDER=geth yarn wsrun test:circleci @0x/contracts-erc721
- run: TEST_PROVIDER=geth yarn wsrun test:circleci @0x/contracts-extensions
- run: TEST_PROVIDER=geth yarn wsrun test:circleci @0x/contracts-asset-proxy
- run: TEST_PROVIDER=geth yarn wsrun test:circleci @0x/contracts-exchange
- run: TEST_PROVIDER=geth yarn wsrun test:circleci @0x/contracts-exchange-forwarder
- run: sleep 10 && TEST_PROVIDER=geth 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-publish:
resource_class: medium+
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
- image: 0xorg/verdaccio
working_directory: ~/repo
steps:
@@ -84,30 +83,16 @@ 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:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn test:generate_docs:circleci
test-pipeline:
docker:
- image: circleci/node:9
- image: postgres:11-alpine
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: ZEROEX_DATA_PIPELINE_TEST_DB_URL='postgresql://postgres@localhost/postgres' yarn wsrun test:circleci @0x/pipeline
- save_cache:
key: coverage-pipeline-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/pipeline/coverage/lcov.info
test-rest:
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
working_directory: ~/repo
steps:
- restore_cache:
@@ -115,15 +100,15 @@ jobs:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn wsrun test:circleci @0x/contracts-test-utils
- run: yarn wsrun test:circleci @0x/abi-gen
- run: yarn wsrun test:circleci @0x/asset-buyer
- run: yarn wsrun test:circleci @0x/contract-artifacts
- run: yarn wsrun test:circleci @0x/assert
- run: yarn wsrun test:circleci @0x/base-contract
- run: yarn wsrun test:circleci @0x/connect
- run: yarn wsrun test:circleci @0x/contract-wrappers
- run: yarn wsrun test:circleci @0x/dev-utils
- run: yarn wsrun test:circleci @0x/json-schemas
- run: yarn wsrun test:circleci @0x/metacoin
- run: yarn wsrun test:circleci @0x/order-utils
- run: yarn wsrun test:circleci @0x/order-watcher
- run: yarn wsrun test:circleci @0x/sol-compiler
- run: yarn wsrun test:circleci @0x/sol-tracing-utils
- run: yarn wsrun test:circleci @0x/sol-doc
@@ -139,6 +124,10 @@ jobs:
key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/assert/coverage/lcov.info
- save_cache:
key: coverage-asset-buyer-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/asset-buyer/coverage/lcov.info
- save_cache:
key: coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }}
paths:
@@ -159,18 +148,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:
@@ -194,31 +175,38 @@ 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: |
yarn start:ts -p 3000:3000
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: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
command: |
cd python-packages
python -m ensurepip
./pre_install
./install
- save_cache:
key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
paths:
- '/usr/local/bin'
- '/usr/local/lib/python3.7/site-packages'
- 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:
@@ -243,23 +231,37 @@ 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/*/__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: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- run:
command: |
cd python-packages/order_utils
python -m ensurepip
python -m pip install .
- save_cache:
key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
paths:
- '/usr/local/bin'
- '/usr/local/lib/python3.7/site-packages'
@@ -274,23 +276,25 @@ 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: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
command: |
python -m ensurepip
cd python-packages
./pre_install
./install
./lint
static-tests:
working_directory: ~/repo
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
steps:
- restore_cache:
keys:
@@ -298,11 +302,12 @@ jobs:
- run: yarn lerna run lint
- run: yarn prettier:ci
- run: yarn deps_versions:ci
- run: yarn diff_md_docs:ci
- run: cd packages/0x.js && yarn build:umd:prod
- run: yarn bundlewatch
submit-coverage:
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
working_directory: ~/repo
steps:
- restore_cache:
@@ -314,6 +319,9 @@ jobs:
- restore_cache:
keys:
- coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-asset-buyer-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }}
@@ -329,15 +337,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 }}
@@ -386,12 +388,11 @@ workflows:
- test-contracts-ganache:
requires:
- build
- test-contracts-geth:
requires:
- build
- test-pipeline:
requires:
- build
# TODO(albrow): Tests always fail on Geth right now because our fork
# is outdated. Uncomment once we have updated our Geth fork.
# - test-contracts-geth:
# requires:
# - build
- test-rest:
requires:
- build
@@ -411,6 +412,8 @@ workflows:
- static-tests-python:
requires:
- test-python
- test-python
- test-python:
requires:
- build
# skip python tox run for now, as we don't yet have multiple test environments to support.
#- test-rest-python

7
.gitattributes vendored
View File

@@ -1,7 +1,8 @@
*.sol linguist-language=Solidity
# Automatically collapse generated files in GitHub.
*.svg linguist-generated
packages/contract-artifacts/artifacts/*json linguist-generated
packages/abi-gen-wrappers/wrappers/*.ts liguist-generated
*.svg linguist-generated=true
packages/contract-artifacts/artifacts/*json linguist-generated=true
packages/abi-gen-wrappers/src/generated-wrappers/*.ts linguist-generated=true
packages/contract-wrappers/src/generated-wrappers/*.ts linguist-generated=true

View File

@@ -1,42 +1,39 @@
python: ['python-packages']
contracts: ['contracts']
sol-doc: ['packages/sol-doc']
sol-resolver: ['packages/sol-resolver']
sra-spec: ['packages/sra-spec']
subproviders: ['packages/subproviders']
contract-addresses: ['packages/contract-addresses']
migrations: ['packages/migrations']
web3-wrapper: ['packages/web3-wrapper']
sol-compiler: ['packages/sol-compiler']
types: ['packages/types']
instant: ['packages/instant']
abi-gen-templates: ['packages/abi-gen-templates']
abi-gen: ['packages/abi-gen']
website: ['packages/website']
sol-coverage: ['packages/sol-coverage']
sol-profiler: ['packages/sol-profiler']
sol-trace: ['packages/sol-trace']
sol-tracing-utils: ['packages/sol-tracing-utils']
utils: ['packages/utils']
tslint-config: ['packages/tslint-config']
asset-buyer: ['packages/asset-buyer']
order-watcher: ['packages/order-watcher']
react-docs: ['packages/react-docs']
order-utils: ['packages/order-utils']
react-shared: ['packages/react-shared']
assert: ['packages/assert']
base-contract: ['packages/base-contract']
typescript-typings: ['packages/typescript-typings']
@0x/sol-doc: ['packages/sol-doc']
@0x/sol-resolver: ['packages/sol-resolver']
@0x/contracts-gen: ['packages/contracts-gen']
@0x/sra-spec: ['packages/sra-spec']
@0x/subproviders: ['packages/subproviders']
@0x/contract-addresses: ['packages/contract-addresses']
@0x/migrations: ['packages/migrations']
@0x/web3-wrapper: ['packages/web3-wrapper']
@0x/sol-compiler: ['packages/sol-compiler']
@0x/types: ['packages/types']
@0x/instant: ['packages/instant']
@0x/abi-gen-templates: ['packages/abi-gen-templates']
@0x/abi-gen: ['packages/abi-gen']
@0x/website: ['packages/website']
@0x/sol-coverage: ['packages/sol-coverage']
@0x/sol-profiler: ['packages/sol-profiler']
@0x/sol-trace: ['packages/sol-trace']
@0x/sol-tracing-utils: ['packages/sol-tracing-utils']
@0x/utils: ['packages/utils']
@0x/tslint-config: ['packages/tslint-config']
@0x/asset-buyer: ['packages/asset-buyer']
@0x/order-utils: ['packages/order-utils']
@0x/assert: ['packages/assert']
@0x/base-contract: ['packages/base-contract']
@0x/typescript-typings: ['packages/typescript-typings']
0x.js: ['packages/0x.js']
abi-gen-wrappers: ['packages/abi-gen-wrappers']
metacoin: ['packages/metacoin']
contract-artifacts: ['packages/contract-artifacts']
dev-utils: ['packages/dev-utils']
contract-wrappers: ['packages/contract-wrappers']
json-schemas: ['packages/json-schemas']
ethereum-types: ['ethereum-types']
connect: ['packages/connect']
fill-scenarios: ['packages/fill-scenarios']
dev-tools-pages: ['packages/dev-tools-pages']
testnet-faucets: ['packages/testnet-faucets']
monorepo-scripts: ['packages/monorepo-scripts']
@0x/abi-gen-wrappers: ['packages/abi-gen-wrappers']
@0x/contract-artifacts: ['packages/contract-artifacts']
@0x/dev-utils: ['packages/dev-utils']
@0x/contract-wrappers: ['packages/contract-wrappers']
@0x/json-schemas: ['packages/json-schemas']
@0x/ethereum-types: ['ethereum-types']
@0x/connect: ['packages/connect']
@0x/fill-scenarios: ['packages/fill-scenarios']
@0x/dev-tools-pages: ['packages/dev-tools-pages']
@0x/testnet-faucets: ['packages/testnet-faucets']
@0x/monorepo-scripts: ['packages/monorepo-scripts']

49
.gitignore vendored
View File

@@ -40,9 +40,12 @@ build/Release
node_modules/
jspm_packages/
# Typescript v1 declaration files
# TypeScript v1 declaration files
typings/
# NVM config
.nvmrc
# Optional npm cache directory
.npm
.npmrc
@@ -77,12 +80,12 @@ TODO.md
packages/website/public/bundle*
packages/dev-tools-pages/public/bundle*
packages/react-docs/example/public/bundle*
# server cli
packages/testnet-faucets/server/
# generated contract artifacts/
contracts/coordinator/generated-artifacts/
contracts/exchange/generated-artifacts/
contracts/asset-proxy/generated-artifacts/
contracts/multisig/generated-artifacts/
@@ -90,13 +93,16 @@ contracts/utils/generated-artifacts/
contracts/exchange-libs/generated-artifacts/
contracts/erc20/generated-artifacts/
contracts/erc721/generated-artifacts/
contracts/erc1155/generated-artifacts/
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
packages/abi-gen-wrappers/wrappers
packages/python-contract-wrappers/generated/
contracts/coordinator/generated-wrappers/
contracts/exchange/generated-wrappers/
contracts/asset-proxy/generated-wrappers/
contracts/multisig/generated-wrappers/
@@ -104,16 +110,34 @@ contracts/utils/generated-wrappers/
contracts/exchange-libs/generated-wrappers/
contracts/erc20/generated-wrappers/
contracts/erc721/generated-wrappers/
contracts/erc1155/generated-wrappers/
contracts/extensions/generated-wrappers/
contracts/exchange-forwarder/generated-wrappers/
packages/metacoin/src/contract_wrappers
contracts/dev-utils/generated-wrappers/
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_token/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/exchange/__init__.py
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/
# Monorepo scripts
packages/*/scripts/
# python stuff
.eggs
.mypy_cache
@@ -123,3 +147,12 @@ 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
# Doc README copy
packages/*/docs/README.md
# Tool MDX files authoritatively live on S3
packages/website/mdx/tools/*

View File

@@ -1,5 +1,7 @@
lib
.nyc_output
/contracts/coordinator/generated-wrappers
/contracts/coordinator/generated-artifacts
/contracts/exchange/generated-wrappers
/contracts/exchange/generated-artifacts
/contracts/asset-proxy/generated-wrappers
@@ -14,17 +16,17 @@ lib
/contracts/erc20/generated-artifacts
/contracts/erc721/generated-wrappers
/contracts/erc721/generated-artifacts
/contracts/erc1155/generated-wrappers
/contracts/erc1155/generated-artifacts
/contracts/extensions/generated-wrappers
/contracts/extensions/generated-artifacts
/contracts/exchange-forwarder/generated-wrappers
/contracts/exchange-forwarder/generated-artifacts
/packages/abi-gen-wrappers/src/generated-wrappers
/packages/contract-artifacts/artifacts
/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts
/contracts/dev-utils/generated-wrappers
/contracts/dev-utils/generated-artifacts
/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
@@ -33,3 +35,8 @@ 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
packages/*/docs
packages/website/mdx/tools

View File

@@ -11,18 +11,18 @@ packages/website/ @BMillman19 @fragosti @fabioberger @steveklebanoff
# Dev tools & setup
.circleci/ @LogvinovLeon
packages/abi-gen/ @LogvinovLeon
packages/base-contract/ @LogvinovLeon
packages/abi-gen/ @feuGeneA
packages/base-contract/ @xianny
packages/connect/ @fragosti
packages/abi-gen-templates/ @LogvinovLeon
packages/abi-gen-templates/ @feuGeneA @xianny
packages/contract-addresses/ @albrow
packages/contract-artifacts/ @albrow
packages/dev-utils/ @LogvinovLeon @fabioberger
packages/devnet/ @albrow
packages/ethereum-types/ @LogvinovLeon
packages/metacoin/ @LogvinovLeon
packages/monorepo-scripts/ @fabioberger
packages/order-utils/ @fabioberger @LogvinovLeon
packages/python-contract-wrappers/ @feuGeneA
packages/sol-compiler/ @LogvinovLeon
packages/sol-coverage/ @LogvinovLeon
packages/sol-profiler/ @LogvinovLeon
@@ -33,6 +33,7 @@ packages/subproviders/ @fabioberger @dekz
packages/verdaccio/ @albrow
packages/web3-wrapper/ @LogvinovLeon @fabioberger
python-packages/ @feuGeneA
packages/utils/ @hysz
# Protocol/smart contracts
contracts/core/test/ @albrow
contracts/ @abandeali1 @hysz

View File

@@ -55,7 +55,7 @@ If an entry without a `timestamp` already exists, this means other changes have
### Development Tooling
We strongly recommend you use the [VSCode](https://code.visualstudio.com/) text editor since most of our code is written in Typescript and it offers amazing support for the language.
We strongly recommend you use the [VSCode](https://code.visualstudio.com/) text editor since most of our code is written in TypeScript and it offers amazing support for the language.
#### Linter
@@ -89,7 +89,7 @@ A few of our coding conventions are not yet enforced by the linter/auto-formatte
1. Do not import from a project's `index.ts` (e.g import { Token } from '../src';). Always import from the source file itself.
1. Generic error variables should be named `err` instead of `e` or `error`.
1. If you _must_ cast a variable to any - try to type it back as fast as possible. (e.g., `const cw = ((zeroEx as any)._contractWrappers as ContractWrappers);`). This ensures subsequent code is type-safe.
1. Our enum conventions coincide with the recommended Typescript conventions, using capitalized keys, and all-caps snake-case values. Eg `GetStats = 'GET_STATS'`
1. Our enum conventions coincide with the recommended TypeScript conventions, using capitalized keys, and all-caps snake-case values. Eg `GetStats = 'GET_STATS'`
1. All public, exported methods/functions/classes must have associated Javadoc-style comments.
### Fix `submit-coverage` CI failure

View File

@@ -2,7 +2,7 @@
<!--- Before submitting please check to see if this issue was already reported -->
<!--- Provide a general summary of the issue in the Title above -->
<!--- Prefix your issue title with the package name it relates to (e.g., `0x.js: ` or `general:`) -->
## Expected Behavior

View File

@@ -6,21 +6,16 @@
This repository is a monorepo including the 0x protocol smart contracts and numerous developer tools. Each public sub-package is independently published to NPM.
If you're developing on 0x now or are interested in using 0x infrastructure in the future, please join our [developer mailing list][dev-mailing-list-url] for updates.
[website-url]: https://0xproject.com
[whitepaper-url]: https://0xproject.com/pdfs/0x_white_paper.pdf
[dev-mailing-list-url]: http://eepurl.com/dx4cPf
[website-url]: https://0x.org
[![CircleCI](https://circleci.com/gh/0xProject/0x-monorepo.svg?style=svg&circle-token=61bf7cd8c9b4e11b132089dfcffdd1be277d1e0c)](https://circleci.com/gh/0xProject/0x-monorepo)
[![Coverage Status](https://coveralls.io/repos/github/0xProject/0x-monorepo/badge.svg?branch=development)](https://coveralls.io/github/0xProject/0x-monorepo?branch=development)
[![Discord](https://img.shields.io/badge/chat-rocket.chat-yellow.svg?style=flat)](https://chat.0xproject.com)
[![Join the chat at https://gitter.im/0xProject/Lobby](https://badges.gitter.im/0xProject/Lobby.svg)](https://gitter.im/0xProject/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Discord](https://img.shields.io/badge/chat-discord.chat-yellow.svg?style=flat)](https://discordapp.com/invite/d3FTX3M)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
## Packages
Visit our [developer portal](https://0xproject.com/docs/order-utils) for a comprehensive list of core & community maintained packages. All packages maintained with this monorepo are listed below.
Visit our [developer portal](https://0x.org/docs/tools/order-utils) for a comprehensive list of core & community maintained packages. All packages maintained with this monorepo are listed below.
### Python Packages
@@ -28,26 +23,32 @@ 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 |
### Solidity Packages
These packages are all under development. See [/contracts/README.md](/contracts/README.md) for a list of deployed packages.
| Package | Version | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`@0x/contracts-asset-proxy`](/contracts/asset-proxy) | [![npm](https://img.shields.io/npm/v/@0x/contracts-asset-proxy.svg)](https://www.npmjs.com/package/@0x/contracts-asset-proxy) | [`AssetProxy`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxy) contracts used within the protocol |
| [`@0x/contracts-erc20`](/contracts/erc20) | [![npm](https://img.shields.io/npm/v/@0x/contracts-erc20.svg)](https://www.npmjs.com/package/@0x/contracts-erc20) | Implementations of various ERC20 tokens |
| [`@0x/contracts-erc721`](/contracts/erc721) | [![npm](https://img.shields.io/npm/v/@0x/contracts-erc721.svg)](https://www.npmjs.com/package/@0x/contracts-erc721) | Implementations of various ERC721 tokens |
| [`@0x/contracts-erc1155`](/contracts/erc1155) | [![npm](https://img.shields.io/npm/v/@0x/contracts-erc1155.svg)](https://www.npmjs.com/package/@0x/contracts-erc1155) | Implementations of various ERC1155 tokens |
| [`@0x/contracts-exchange`](/contracts/exchange) | [![npm](https://img.shields.io/npm/v/@0x/contracts-exchange.svg)](https://www.npmjs.com/package/@0x/contracts-exchange) | The [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract used for settling trades within the protocol |
| [`@0x/contracts-exchange-forwarder`](/contracts/exchange-forwarder) | [![npm](https://img.shields.io/npm/v/@0x/contracts-exchange-forwarder.svg)](https://www.npmjs.com/package/@0x/contracts-exchange-forwarder) | A [`Forwarder`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/forwarder-specification.md) contract used to simplify UX for interacting with the protocol |
| [`@0x/contracts-exchange-libs`](/contracts/exchange-libs) | [![npm](https://img.shields.io/npm/v/@0x/contracts-exchange-libs.svg)](https://www.npmjs.com/package/@0x/contracts-exchange-libs) | Protocol specific Llbraries used within the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract |
| [`@0x/contracts-exchange-libs`](/contracts/exchange-libs) | [![npm](https://img.shields.io/npm/v/@0x/contracts-exchange-libs.svg)](https://www.npmjs.com/package/@0x/contracts-exchange-libs) | Protocol specific libraries used within the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract |
| [`@0x/contracts-extensions`](/contracts/extensions) | [![npm](https://img.shields.io/npm/v/@0x/contracts-extensions.svg)](https://www.npmjs.com/package/@0x/contracts-extensions) | Contracts that interact with and extend the functionality of the core protocol |
| [`@0x/contracts-multisig`](/contracts/multisig) | [![npm](https://img.shields.io/npm/v/@0x/contracts-multisig.svg)](https://www.npmjs.com/package/@0x/contracts-multisig) | Various implementations of multisignature wallets, including the [`AssetProxyOwner`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxyowner) contract that has permissions to upgrade the protocol |
| [`@0x/contracts-test-utils`](/contracts/test-utils) | [![npm](https://img.shields.io/npm/v/@0x/contracts-test-utils.svg)](https://www.npmjs.com/package/@0x/contracts-test-utils) | Typescript/Javascript shared utilities used for testing contracts |
| [`@0x/contracts-test-utils`](/contracts/test-utils) | [![npm](https://img.shields.io/npm/v/@0x/contracts-test-utils.svg)](https://www.npmjs.com/package/@0x/contracts-test-utils) | TypeScript/Javascript shared utilities used for testing contracts |
| [`@0x/contracts-utils`](/contracts/utils) | [![npm](https://img.shields.io/npm/v/@0x/contracts-utils.svg)](https://www.npmjs.com/package/@0x/contracts-utils) | Generic libraries and utilities used throughout all of the contracts |
| [`@0x/contracts-coordinator`](/contracts/coordinator) | [![npm](https://img.shields.io/npm/v/@0x/contracts-coordinator.svg)](https://www.npmjs.com/package/@0x/contracts-coordinator) | A contract that allows users to execute 0x transactions with permission from a Coordinator |
| [`@0x/contracts-dev-utils`](/contracts/dev-utils) | [![npm](https://img.shields.io/npm/v/@0x/contracts-dev-utils.svg)](https://www.npmjs.com/package/@0x/contracts-dev-utils) | A contract contains utility functions for developers (such as validating many orders using a single eth_call) |
### Typescript/Javascript Packages
### TypeScript/Javascript Packages
#### 0x-specific packages
@@ -57,14 +58,14 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
| [`@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
@@ -81,19 +82,17 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
#### 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
@@ -105,7 +104,7 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
## 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.
@@ -134,6 +133,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:

16
contracts/README.md Normal file
View File

@@ -0,0 +1,16 @@
#### Deployed Contract Packages
| Contract | Package | Version | Git Tag |
| --------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| AssetProxyOwner | [`@0x/contracts-multisig`](/contracts/multisig) | [v1.0.2](https://www.npmjs.com/package/@0x/contracts-multisig/v/1.0.2) | [@0x/contracts-multisig@1.0.2](https://github.com/0xProject/0x-monorepo/releases/tag/@0x/contracts-multisig@1.0.2) |
| ERC20Proxy | [`@0x/contracts-asset-proxy`](/contracts/asset-proxy) | [v1.0.1](https://www.npmjs.com/package/@0x/contracts-asset-proxy/v/1.0.1) | [@0x/contracts-asset-proxy@1.0.1](https://github.com/0xProject/0x-monorepo/releases/tag/@0x/contracts-asset-proxy@1.0.1) |
| ERC721Proxy | [`@0x/contracts-asset-proxy`](/contracts/asset-proxy) | [v1.0.1](https://www.npmjs.com/package/@0x/contracts-asset-proxy/v/1.0.1) | [@0x/contracts-asset-proxy@1.0.1](https://github.com/0xProject/0x-monorepo/releases/tag/@0x/contracts-asset-proxy@1.0.1) |
| Exchange | [`@0x/contracts-exchange`](/contracts/exchange) | [v1.0.1](https://www.npmjs.com/package/@0x/contracts-exchange/v/1.0.1) | [@0x/contracts-exchange@1.0.1](https://github.com/0xProject/0x-monorepo/releases/tag/@0x/contracts-exchange@1.0.1) |
| DutchAuction | [`@0x/contracts-extensions`](/contracts/extensions) | [v1.0.2](https://www.npmjs.com/package/@0x/contracts-extensions/v/1.0.2) | [@0x/contracts-extensions@1.0.2](https://github.com/0xProject/0x-monorepo/releases/tag/@0x/contracts-extensions@1.0.2) |
| Forwarder | [`@0x/contracts-exchange-forwarder`](/contracts/exchange-forwarder) | [v1.0.1](https://www.npmjs.com/package/@0x/contracts-exchange-forwarder/v/1.0.1) | [@0x/contracts-exchange-forwarder@1.0.1](https://github.com/0xProject/0x-monorepo/releases/tag/@0x/contracts-exchange-forwarder@1.0.1) |
| MultiAssetProxy | [`@0x/contracts-asset-proxy`](/contracts/asset-proxy) | [v1.0.1](https://www.npmjs.com/package/@0x/contracts-asset-proxy/v/1.0.1) | [@0x/contracts-asset-proxy@1.0.1](https://github.com/0xProject/0x-monorepo/releases/tag/@0x/contracts-asset-proxy@1.0.1) |
| ZRXToken | [`@0x/contracts-erc20`](/contracts/erc20) | [v1.0.1](https://www.npmjs.com/package/@0x/contracts-erc20/v/1.0.1) | [@0x/contracts-erc20@1.0.1](https://github.com/0xProject/0x-monorepo/releases/tag/@0x/contracts-erc20@1.0.1) |
#### Development
Building solidity files will update the contract artifact in `{package-name}/generated-artifacts/{contract}.json`, but does not automatically update the `abi-gen-wrappers` package, which are generated from the artifact JSON. To ensure consistency, clean and rebuild `abi-gen-wrappers` after any changes to the artifact JSON.

View File

@@ -1,4 +1,227 @@
[
{
"timestamp": 1567521715,
"version": "2.2.7",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"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": [
{
"note": "Add `LibAssetProxyIds` contract",
"pr": 1835
},
{
"note": "Updated ERC1155 Asset Proxy. Less optimization. More explicit handling of edge cases.",
"pr": 1852
},
{
"note": "Implement StaticCallProxy",
"pr": 1863
}
],
"timestamp": 1563006338
},
{
"timestamp": 1558712885,
"version": "2.1.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1557961111,
"version": "2.1.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1557799313,
"version": "2.1.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "2.1.2",
"changes": [
{
"note": "Update tests to use contract-built-in `awaitTransactionSuccessAsync`",
"pr": 1797
}
],
"timestamp": 1557507213
},
{
"version": "2.1.1",
"changes": [
{
"note": "Dependencies updated"
}
],
"timestamp": 1554997931
},
{
"version": "2.1.0",
"changes": [
{
"note": "Run Web3ProviderEngine without excess block polling",
"pr": 1695
}
],
"timestamp": 1553183790
},
{
"version": "2.0.0",
"changes": [
{
"note": "Do not reexport external dependencies",
"pr": 1682
},
{
"note": "Add ERC1155Proxy",
"pr": 1661
},
{
"note": "Bumped solidity version to ^0.5.5",
"pr": 1701
},
{
"note": "Integration testing for ERC1155Proxy",
"pr": 1673
}
],
"timestamp": 1553091633
},
{
"timestamp": 1551479279,
"version": "1.0.9",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1551299797,
"version": "1.0.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1551220833,
"version": "1.0.7",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1551130135,
"version": "1.0.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1549733923,
"version": "1.0.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "1.0.4",
"changes": [
{
"note": "Dependencies updated"
}
],
"timestamp": 1549547375
},
{
"version": "1.0.3",
"changes": [
{
"note": "Fake publish to enable pinning"
}
],
"timestamp": 1549504360
},
{
"timestamp": 1549452781,
"version": "1.0.2",

View File

@@ -5,6 +5,99 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v2.2.7 - _September 3, 2019_
* Dependencies updated
## 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)
* Updated ERC1155 Asset Proxy. Less optimization. More explicit handling of edge cases. (#1852)
* Implement StaticCallProxy (#1863)
## v2.1.5 - _May 24, 2019_
* Dependencies updated
## v2.1.4 - _May 15, 2019_
* Dependencies updated
## v2.1.3 - _May 14, 2019_
* Dependencies updated
## v2.1.2 - _May 10, 2019_
* Update tests to use contract-built-in `awaitTransactionSuccessAsync` (#1797)
## v2.1.1 - _April 11, 2019_
* Dependencies updated
## v2.1.0 - _March 21, 2019_
* Run Web3ProviderEngine without excess block polling (#1695)
## v2.0.0 - _March 20, 2019_
* Do not reexport external dependencies (#1682)
* Add ERC1155Proxy (#1661)
* Bumped solidity version to ^0.5.5 (#1701)
* Integration testing for ERC1155Proxy (#1673)
## v1.0.9 - _March 1, 2019_
* Dependencies updated
## v1.0.8 - _February 27, 2019_
* Dependencies updated
## v1.0.7 - _February 26, 2019_
* Dependencies updated
## v1.0.6 - _February 25, 2019_
* Dependencies updated
## v1.0.5 - _February 9, 2019_
* Dependencies updated
## v1.0.4 - _February 7, 2019_
* Dependencies updated
## v1.0.3 - _February 7, 2019_
* Fake publish to enable pinning
## v1.0.2 - _February 6, 2019_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
## AssetProxy
This package contains the implementations of all of the [`AssetProxy`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxy) contracts available within the 0x protocol. These contracts are responsible for decoding the `assetData` sent to them and performing the actual transfer of assets. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
This package contains the implementations of all of the [`AssetProxy`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxy) contracts available within the 0x protocol. These contracts are responsible for decoding the `assetData` sent to them and performing the actual transfer of assets. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
## Installation
@@ -12,7 +12,7 @@ npm install @0x/contracts-asset-proxy --save
## Bug bounty
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
## Contributing

View File

@@ -1,16 +1,20 @@
{
"artifactsDir": "./generated-artifacts",
"contractsDir": "./contracts",
"useDockerisedSolc": true,
"useDockerisedSolc": false,
"isOfflineMode": false,
"compilerSettings": {
"evmVersion": "constantinople",
"optimizer": {
"enabled": true,
"runs": 1000000
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": {
"*": {
"*": [
"abi",
"devdoc",
"evm.bytecode.object",
"evm.bytecode.sourceMap",
"evm.deployedBytecode.object",
@@ -20,12 +24,15 @@
}
},
"contracts": [
"IAssetData",
"IAssetProxy",
"IAuthorizable",
"ERC20Proxy",
"ERC721Proxy",
"MixinAuthorizable",
"MultiAssetProxy"
"src/ERC1155Proxy.sol",
"src/ERC20Proxy.sol",
"src/ERC721Proxy.sol",
"src/MixinAuthorizable.sol",
"src/MultiAssetProxy.sol",
"src/StaticCallProxy.sol",
"src/interfaces/IAssetData.sol",
"src/interfaces/IAssetProxy.sol",
"src/interfaces/IAuthorizable.sol",
"test/TestStaticCallTarget.sol"
]
}

View File

@@ -0,0 +1,97 @@
/*
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.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,
SafeMath,
IAssetProxy
{
using LibBytes for bytes;
// Id of this proxy.
bytes4 constant internal PROXY_ID = bytes4(keccak256("ERC1155Assets(address,uint256[],uint256[],bytes)"));
/// @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
{
// 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
// 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.
/// @return Proxy id.
function getProxyId()
external
pure
returns (bytes4)
{
return PROXY_ID;
}
}

View File

@@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
import "./MixinAuthorizable.sol";

View File

@@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
import "./MixinAuthorizable.sol";

View File

@@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/Ownable.sol";
import "./mixins/MAssetProxyDispatcher.sol";
@@ -28,7 +28,7 @@ contract MixinAssetProxyDispatcher is
MAssetProxyDispatcher
{
// Mapping from Asset Proxy Id's to their respective Asset Proxy
mapping (bytes4 => IAssetProxy) public assetProxies;
mapping (bytes4 => address) public assetProxies;
/// @dev Registers an asset proxy to its asset proxy id.
/// Once an asset proxy is registered, it cannot be unregistered.
@@ -37,10 +37,8 @@ contract MixinAssetProxyDispatcher is
external
onlyOwner
{
IAssetProxy assetProxyContract = IAssetProxy(assetProxy);
// Ensure that no asset proxy exists with current id.
bytes4 assetProxyId = assetProxyContract.getProxyId();
bytes4 assetProxyId = IAssetProxy(assetProxy).getProxyId();
address currentAssetProxy = assetProxies[assetProxyId];
require(
currentAssetProxy == address(0),
@@ -48,7 +46,7 @@ contract MixinAssetProxyDispatcher is
);
// Add asset proxy and log registration.
assetProxies[assetProxyId] = assetProxyContract;
assetProxies[assetProxyId] = assetProxy;
emit AssetProxyRegistered(
assetProxyId,
assetProxy

View File

@@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/Ownable.sol";
import "./mixins/MAuthorizable.sol";

View File

@@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
import "./MixinAssetProxyDispatcher.sol";
import "./MixinAuthorizable.sol";
@@ -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

@@ -0,0 +1,83 @@
/*
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.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)"));
/// @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
{
// Decode params from `assetData`
(
address staticCallTarget,
bytes memory staticCallData,
bytes32 expectedReturnDataHash
) = abi.decode(
assetData.sliceDestructive(4, assetData.length),
(address, bytes, bytes32)
);
// Execute staticcall
(bool success, bytes memory returnData) = staticCallTarget.staticcall(staticCallData);
// Revert with returned data if staticcall is unsuccessful
if (!success) {
assembly {
revert(add(returnData, 32), mload(returnData))
}
}
// 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.
/// @return Proxy id.
function getProxyId()
external
pure
returns (bytes4)
{
return PROXY_ID;
}
}

View File

@@ -17,7 +17,7 @@
*/
// solhint-disable
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
@@ -26,19 +26,33 @@ pragma experimental ABIEncoderV2;
// This argument is ABI encoded as one of the methods of this interface.
interface IAssetData {
function ERC20Token(address tokenContract)
function ERC20Token(address tokenAddress)
external;
function ERC721Token(
address tokenContract,
address tokenAddress,
uint256 tokenId
)
external;
function MultiAsset(
uint256[] amounts,
bytes[] nestedAssetData
function ERC1155Assets(
address tokenAddress,
uint256[] calldata tokenIds,
uint256[] calldata tokenValues,
bytes calldata callbackData
)
external;
function MultiAsset(
uint256[] calldata amounts,
bytes[] calldata nestedAssetData
)
external;
function StaticCall(
address callTarget,
bytes calldata staticCallData,
bytes32 callResultHash
)
external;
}

View File

@@ -16,21 +16,20 @@
*/
pragma solidity ^0.4.24;
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.
/// @param to Address to transfer asset to.
/// @param amount Amount of asset to transfer.
function transferFrom(
bytes assetData,
bytes calldata assetData,
address from,
address to,
uint256 amount

View File

@@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
contract IAssetProxyDispatcher {

View File

@@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/interfaces/IOwnable.sol";

View File

@@ -0,0 +1,40 @@
/*
Copyright 2019 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 LibAssetProxyIds {
// AssetProxy Ids are equiavalent the first 4 bytes of the keccak256 hash of the function signature assigned to each AssetProxy.
// ERC20Token(address)
bytes4 constant public ERC20_PROXY_ID = 0xf47261b0;
// ERC721Token(address,uint256)
bytes4 constant public ERC721_PROXY_ID = 0x02571792;
// ERC1155Assets(address,uint256[],uint256[],bytes)
bytes4 constant public ERC1155_PROXY_ID = 0xa7cb5fb7;
// MultiAsset(uint256[],bytes[])
bytes4 constant public MULTI_ASSET_PROXY_ID = 0x94cfcdd7;
// StaticCall(address,bytes,bytes32)
bytes4 constant public STATIC_CALL_PROXY_ID = 0xc339d10a;
}

View File

@@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "../interfaces/IAssetProxyDispatcher.sol";

View File

@@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "../interfaces/IAuthorizable.sol";

View File

@@ -0,0 +1,82 @@
/*
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.9;
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
contract TestStaticCallTarget {
using LibBytes for bytes;
uint256 internal _state;
function updateState()
external
{
_state++;
}
function assertEvenNumber(uint256 target)
external
pure
{
require(
target % 2 == 0,
"TARGET_NOT_EVEN"
);
}
function isOddNumber(uint256 target)
external
pure
returns (bool isOdd)
{
isOdd = target % 2 == 1;
return isOdd;
}
function noInputFunction()
external
pure
{
assert(msg.data.length == 4 && msg.data.readBytes4(0) == bytes4(keccak256("noInputFunction()")));
}
function dynamicInputFunction(bytes calldata a)
external
pure
{
bytes memory abiEncodedData = abi.encodeWithSignature("dynamicInputFunction(bytes)", a);
assert(msg.data.equals(abiEncodedData));
}
function returnComplexType(uint256 a, uint256 b)
external
view
returns (bytes memory result)
{
result = abi.encodePacked(
address(this),
a,
b
);
return result;
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-asset-proxy",
"version": "1.0.2",
"version": "2.2.7",
"engines": {
"node": ">=6.12"
},
@@ -22,17 +22,20 @@
"compile": "sol-compiler",
"watch": "sol-compiler -w",
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
"coverage:report:text": "istanbul report text",
"coverage:report:html": "istanbul report html && open coverage/index.html",
"profiler:report:html": "istanbul report html && open coverage/index.html",
"coverage:report:lcov": "istanbul report lcov",
"test:circleci": "yarn test",
"contracts:gen": "contracts-gen",
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
},
"config": {
"abis": "generated-artifacts/@(ERC20Proxy|ERC721Proxy|IAssetData|IAssetProxy|IAuthorizable|MixinAuthorizable|MultiAssetProxy).json"
"abis": "./generated-artifacts/@(ERC1155Proxy|ERC20Proxy|ERC721Proxy|IAssetData|IAssetProxy|IAuthorizable|MixinAuthorizable|MultiAssetProxy|StaticCallProxy|TestStaticCallTarget).json",
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
},
"repository": {
"type": "git",
@@ -44,18 +47,21 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
"devDependencies": {
"@0x/abi-gen": "^2.0.1",
"@0x/dev-utils": "^2.0.1",
"@0x/sol-compiler": "^3.0.1",
"@0x/tslint-config": "^3.0.0",
"@0x/abi-gen": "^4.2.0",
"@0x/contracts-gen": "^1.0.14",
"@0x/contracts-test-utils": "^3.1.15",
"@0x/dev-utils": "^2.3.2",
"@0x/sol-compiler": "^3.1.14",
"@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",
@@ -63,18 +69,19 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^4.0.1",
"@0x/contracts-erc20": "^1.0.2",
"@0x/contracts-erc721": "^1.0.2",
"@0x/contracts-test-utils": "^3.0.1",
"@0x/contracts-utils": "^2.0.1",
"@0x/order-utils": "^5.0.0",
"@0x/types": "^2.0.1",
"@0x/typescript-typings": "^4.0.0",
"@0x/utils": "^4.0.2",
"@0x/web3-wrapper": "^4.0.1",
"ethereum-types": "^2.0.0",
"lodash": "^4.17.5"
"@0x/base-contract": "^5.3.3",
"@0x/contracts-erc1155": "^1.1.14",
"@0x/contracts-erc20": "^2.2.13",
"@0x/contracts-erc721": "^2.1.14",
"@0x/contracts-utils": "^3.2.3",
"@0x/order-utils": "^8.3.1",
"@0x/types": "^2.4.2",
"@0x/typescript-typings": "^4.2.5",
"@0x/utils": "^4.5.1",
"@0x/web3-wrapper": "^6.0.12",
"ethereum-types": "^2.1.5",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.11"
},
"publishConfig": {
"access": "public"

View File

@@ -0,0 +1,29 @@
/*
* -----------------------------------------------------------------------------
* Warning: This file is auto-generated by contracts-gen. Don't edit manually.
* -----------------------------------------------------------------------------
*/
import { ContractArtifact } from 'ethereum-types';
import * as ERC1155Proxy from '../generated-artifacts/ERC1155Proxy.json';
import * as ERC20Proxy from '../generated-artifacts/ERC20Proxy.json';
import * as ERC721Proxy from '../generated-artifacts/ERC721Proxy.json';
import * as IAssetData from '../generated-artifacts/IAssetData.json';
import * as IAssetProxy from '../generated-artifacts/IAssetProxy.json';
import * as IAuthorizable from '../generated-artifacts/IAuthorizable.json';
import * as MixinAuthorizable from '../generated-artifacts/MixinAuthorizable.json';
import * as MultiAssetProxy from '../generated-artifacts/MultiAssetProxy.json';
import * as StaticCallProxy from '../generated-artifacts/StaticCallProxy.json';
import * as TestStaticCallTarget from '../generated-artifacts/TestStaticCallTarget.json';
export const artifacts = {
ERC1155Proxy: ERC1155Proxy as ContractArtifact,
ERC20Proxy: ERC20Proxy as ContractArtifact,
ERC721Proxy: ERC721Proxy as ContractArtifact,
MixinAuthorizable: MixinAuthorizable as ContractArtifact,
MultiAssetProxy: MultiAssetProxy as ContractArtifact,
StaticCallProxy: StaticCallProxy as ContractArtifact,
IAssetData: IAssetData as ContractArtifact,
IAssetProxy: IAssetProxy as ContractArtifact,
IAuthorizable: IAuthorizable as ContractArtifact,
TestStaticCallTarget: TestStaticCallTarget as ContractArtifact,
};

View File

@@ -1,19 +0,0 @@
import { ContractArtifact } from 'ethereum-types';
import * as ERC20Proxy from '../../generated-artifacts/ERC20Proxy.json';
import * as ERC721Proxy from '../../generated-artifacts/ERC721Proxy.json';
import * as IAssetData from '../../generated-artifacts/IAssetData.json';
import * as IAssetProxy from '../../generated-artifacts/IAssetProxy.json';
import * as IAuthorizable from '../../generated-artifacts/IAuthorizable.json';
import * as MixinAuthorizable from '../../generated-artifacts/MixinAuthorizable.json';
import * as MultiAssetProxy from '../../generated-artifacts/MultiAssetProxy.json';
export const artifacts = {
IAuthorizable: IAuthorizable as ContractArtifact,
IAssetData: IAssetData as ContractArtifact,
IAssetProxy: IAssetProxy as ContractArtifact,
ERC20Proxy: ERC20Proxy as ContractArtifact,
ERC721Proxy: ERC721Proxy as ContractArtifact,
MixinAuthorizable: MixinAuthorizable as ContractArtifact,
MultiAssetProxy: MultiAssetProxy as ContractArtifact,
};

View File

@@ -0,0 +1,15 @@
/*
* -----------------------------------------------------------------------------
* Warning: This file is auto-generated by contracts-gen. Don't edit manually.
* -----------------------------------------------------------------------------
*/
export * from '../generated-wrappers/erc1155_proxy';
export * from '../generated-wrappers/erc20_proxy';
export * from '../generated-wrappers/erc721_proxy';
export * from '../generated-wrappers/i_asset_data';
export * from '../generated-wrappers/i_asset_proxy';
export * from '../generated-wrappers/i_authorizable';
export * from '../generated-wrappers/mixin_authorizable';
export * from '../generated-wrappers/multi_asset_proxy';
export * from '../generated-wrappers/static_call_proxy';
export * from '../generated-wrappers/test_static_call_target';

View File

@@ -1,7 +0,0 @@
export * from '../../generated-wrappers/i_asset_data';
export * from '../../generated-wrappers/i_asset_proxy';
export * from '../../generated-wrappers/erc20_proxy';
export * from '../../generated-wrappers/erc721_proxy';
export * from '../../generated-wrappers/mixin_authorizable';
export * from '../../generated-wrappers/multi_asset_proxy';
export * from '../../generated-wrappers/i_authorizable';

View File

@@ -37,6 +37,7 @@ describe('Authorizable', () => {
artifacts.MixinAuthorizable,
provider,
txDefaults,
artifacts,
);
});
beforeEach(async () => {
@@ -53,16 +54,18 @@ describe('Authorizable', () => {
);
});
it('should allow owner to add an authorized address', async () => {
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
const isAuthorized = await authorizable.authorized.callAsync(address);
expect(isAuthorized).to.be.true();
});
it('should throw if owner attempts to authorize a duplicate address', async () => {
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
return expectTransactionFailedAsync(
@@ -74,8 +77,9 @@ describe('Authorizable', () => {
describe('removeAuthorizedAddress', () => {
it('should throw if not called by owner', async () => {
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
return expectTransactionFailedAsync(
@@ -87,14 +91,14 @@ describe('Authorizable', () => {
});
it('should allow owner to remove an authorized address', async () => {
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.removeAuthorizedAddress.sendTransactionAsync(address, {
from: owner,
}),
await authorizable.removeAuthorizedAddress.awaitTransactionSuccessAsync(
address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
const isAuthorized = await authorizable.authorized.callAsync(address);
@@ -113,8 +117,9 @@ describe('Authorizable', () => {
describe('removeAuthorizedAddressAtIndex', () => {
it('should throw if not called by owner', async () => {
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
const index = new BigNumber(0);
@@ -126,8 +131,9 @@ describe('Authorizable', () => {
);
});
it('should throw if index is >= authorities.length', async () => {
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
const index = new BigNumber(1);
@@ -150,12 +156,14 @@ describe('Authorizable', () => {
it('should throw if address at index does not match target', async () => {
const address1 = address;
const address2 = notOwner;
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.addAuthorizedAddress.sendTransactionAsync(address1, { from: owner }),
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
address1,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.addAuthorizedAddress.sendTransactionAsync(address2, { from: owner }),
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
address2,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
const address1Index = new BigNumber(0);
@@ -167,15 +175,16 @@ describe('Authorizable', () => {
);
});
it('should allow owner to remove an authorized address', async () => {
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
const index = new BigNumber(0);
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.removeAuthorizedAddressAtIndex.sendTransactionAsync(address, index, {
from: owner,
}),
await authorizable.removeAuthorizedAddressAtIndex.awaitTransactionSuccessAsync(
address,
index,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
const isAuthorized = await authorizable.authorized.callAsync(address);
@@ -187,20 +196,17 @@ describe('Authorizable', () => {
it('should return all authorized addresses', async () => {
const initial = await authorizable.getAuthorizedAddresses.callAsync();
expect(initial).to.have.length(0);
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.addAuthorizedAddress.sendTransactionAsync(address, {
from: owner,
}),
await authorizable.addAuthorizedAddress.awaitTransactionSuccessAsync(
address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
const afterAdd = await authorizable.getAuthorizedAddresses.callAsync();
expect(afterAdd).to.have.length(1);
expect(afterAdd).to.include(address);
await web3Wrapper.awaitTransactionSuccessAsync(
await authorizable.removeAuthorizedAddress.sendTransactionAsync(address, {
from: owner,
}),
await authorizable.removeAuthorizedAddress.awaitTransactionSuccessAsync(
address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
const afterRemove = await authorizable.getAuthorizedAddresses.callAsync();

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,10 @@
import { env, EnvVars } from '@0x/dev-utils';
import { coverage, profiler, provider } from '@0x/contracts-test-utils';
import { providerUtils } from '@0x/utils';
before('start web3 provider', () => {
provider.start();
providerUtils.startProviderEngine(provider);
});
after('generate coverage report', async () => {
if (env.parseBoolean(EnvVars.SolidityCoverage)) {

View File

@@ -1,3 +1,4 @@
import { ERC1155MintableContract, Erc1155Wrapper } from '@0x/contracts-erc1155';
import {
artifacts as erc20Artifacts,
DummyERC20TokenContract,
@@ -22,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';
@@ -30,6 +31,8 @@ import * as _ from 'lodash';
import {
artifacts,
ERC1155ProxyContract,
ERC1155ProxyWrapper,
ERC20ProxyContract,
ERC20Wrapper,
ERC721ProxyContract,
@@ -42,16 +45,8 @@ import {
chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
const assetProxyInterface = new IAssetProxyContract(
artifacts.IAssetProxy.compilerOutput.abi,
constants.NULL_ADDRESS,
provider,
);
const assetDataInterface = new IAssetDataContract(
artifacts.IAssetData.compilerOutput.abi,
constants.NULL_ADDRESS,
provider,
);
const assetProxyInterface = new IAssetProxyContract(constants.NULL_ADDRESS, provider);
const assetDataInterface = new IAssetDataContract(constants.NULL_ADDRESS, provider);
// tslint:disable:no-unnecessary-type-assertion
describe('Asset Transfer Proxies', () => {
@@ -77,6 +72,15 @@ describe('Asset Transfer Proxies', () => {
let erc721AFromTokenId: BigNumber;
let erc721BFromTokenId: BigNumber;
let erc1155Proxy: ERC1155ProxyContract;
let erc1155ProxyWrapper: ERC1155ProxyWrapper;
let erc1155Contract: ERC1155MintableContract;
let erc1155Contract2: ERC1155MintableContract;
let erc1155Wrapper: Erc1155Wrapper;
let erc1155Wrapper2: Erc1155Wrapper;
let erc1155FungibleTokens: BigNumber[];
let erc1155NonFungibleTokensOwnedBySpender: BigNumber[];
before(async () => {
await blockchainLifecycle.startAsync();
});
@@ -97,53 +101,66 @@ describe('Asset Transfer Proxies', () => {
artifacts.MultiAssetProxy,
provider,
txDefaults,
artifacts,
);
// Configure ERC20Proxy
await web3Wrapper.awaitTransactionSuccessAsync(
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, {
from: owner,
}),
await erc20Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
authorized,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, {
from: owner,
}),
await erc20Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
multiAssetProxy.address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
// Configure ERC721Proxy
await web3Wrapper.awaitTransactionSuccessAsync(
await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, {
from: owner,
}),
await erc721Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
authorized,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, {
from: owner,
}),
await erc721Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
multiAssetProxy.address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
// Configure ERC115Proxy
erc1155ProxyWrapper = new ERC1155ProxyWrapper(provider, usedAddresses, owner);
erc1155Proxy = await erc1155ProxyWrapper.deployProxyAsync();
await erc1155Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
authorized,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
await erc1155Proxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
multiAssetProxy.address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
// Configure MultiAssetProxy
await web3Wrapper.awaitTransactionSuccessAsync(
await multiAssetProxy.addAuthorizedAddress.sendTransactionAsync(authorized, {
from: owner,
}),
await multiAssetProxy.addAuthorizedAddress.awaitTransactionSuccessAsync(
authorized,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc20Proxy.address, {
from: owner,
}),
await multiAssetProxy.registerAssetProxy.awaitTransactionSuccessAsync(
erc20Proxy.address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc721Proxy.address, {
from: owner,
}),
await multiAssetProxy.registerAssetProxy.awaitTransactionSuccessAsync(
erc721Proxy.address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
await multiAssetProxy.registerAssetProxy.awaitTransactionSuccessAsync(
erc1155Proxy.address,
{ from: owner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
@@ -157,6 +174,7 @@ describe('Asset Transfer Proxies', () => {
erc20Artifacts.DummyNoReturnERC20Token,
provider,
txDefaults,
artifacts,
constants.DUMMY_TOKEN_NAME,
constants.DUMMY_TOKEN_SYMBOL,
constants.DUMMY_TOKEN_DECIMALS,
@@ -166,6 +184,7 @@ describe('Asset Transfer Proxies', () => {
erc20Artifacts.DummyMultipleReturnERC20Token,
provider,
txDefaults,
artifacts,
constants.DUMMY_TOKEN_NAME,
constants.DUMMY_TOKEN_SYMBOL,
constants.DUMMY_TOKEN_DECIMALS,
@@ -173,31 +192,32 @@ describe('Asset Transfer Proxies', () => {
);
await erc20Wrapper.setBalancesAndAllowancesAsync();
await web3Wrapper.awaitTransactionSuccessAsync(
await noReturnErc20Token.setBalance.sendTransactionAsync(fromAddress, constants.INITIAL_ERC20_BALANCE),
await noReturnErc20Token.setBalance.awaitTransactionSuccessAsync(
fromAddress,
constants.INITIAL_ERC20_BALANCE,
{
from: owner,
},
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await noReturnErc20Token.approve.sendTransactionAsync(
erc20Proxy.address,
constants.INITIAL_ERC20_ALLOWANCE,
{ from: fromAddress },
),
await noReturnErc20Token.approve.awaitTransactionSuccessAsync(
erc20Proxy.address,
constants.INITIAL_ERC20_ALLOWANCE,
{ from: fromAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await multipleReturnErc20Token.setBalance.sendTransactionAsync(
fromAddress,
constants.INITIAL_ERC20_BALANCE,
),
await multipleReturnErc20Token.setBalance.awaitTransactionSuccessAsync(
fromAddress,
constants.INITIAL_ERC20_BALANCE,
{
from: owner,
},
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await multipleReturnErc20Token.approve.sendTransactionAsync(
erc20Proxy.address,
constants.INITIAL_ERC20_ALLOWANCE,
{ from: fromAddress },
),
await multipleReturnErc20Token.approve.awaitTransactionSuccessAsync(
erc20Proxy.address,
constants.INITIAL_ERC20_ALLOWANCE,
{ from: fromAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
@@ -207,12 +227,29 @@ describe('Asset Transfer Proxies', () => {
erc721Artifacts.DummyERC721Receiver,
provider,
txDefaults,
artifacts,
);
await erc721Wrapper.setBalancesAndAllowancesAsync();
const erc721Balances = await erc721Wrapper.getBalancesAsync();
erc721AFromTokenId = erc721Balances[fromAddress][erc721TokenA.address][0];
erc721BFromTokenId = erc721Balances[fromAddress][erc721TokenB.address][0];
// Deploy & configure ERC1155 tokens and receiver
[erc1155Wrapper, erc1155Wrapper2] = await erc1155ProxyWrapper.deployDummyContractsAsync();
erc1155Contract = erc1155Wrapper.getContract();
erc1155Contract2 = erc1155Wrapper2.getContract();
await erc1155ProxyWrapper.setBalancesAndAllowancesAsync();
erc1155FungibleTokens = erc1155ProxyWrapper.getFungibleTokenIds();
const nonFungibleTokens = erc1155ProxyWrapper.getNonFungibleTokenIds();
const tokenBalances = await erc1155ProxyWrapper.getBalancesAsync();
erc1155NonFungibleTokensOwnedBySpender = [];
_.each(nonFungibleTokens, (nonFungibleToken: BigNumber) => {
const nonFungibleTokenAsString = nonFungibleToken.toString();
const nonFungibleTokenHeldBySpender =
tokenBalances.nonFungible[fromAddress][erc1155Contract.address][nonFungibleTokenAsString][0];
erc1155NonFungibleTokensOwnedBySpender.push(nonFungibleTokenHeldBySpender);
});
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();
@@ -370,10 +407,10 @@ describe('Asset Transfer Proxies', () => {
toAddress,
amount,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await erc20TokenA.approve.sendTransactionAsync(erc20Proxy.address, allowance, {
from: fromAddress,
}),
await erc20TokenA.approve.awaitTransactionSuccessAsync(
erc20Proxy.address,
allowance,
{ from: fromAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
const erc20Balances = await erc20Wrapper.getBalancesAsync();
@@ -402,10 +439,10 @@ describe('Asset Transfer Proxies', () => {
toAddress,
amount,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await noReturnErc20Token.approve.sendTransactionAsync(erc20Proxy.address, allowance, {
from: fromAddress,
}),
await noReturnErc20Token.approve.awaitTransactionSuccessAsync(
erc20Proxy.address,
allowance,
{ from: fromAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
const initialFromBalance = await noReturnErc20Token.balanceOf.callAsync(fromAddress);
@@ -643,10 +680,10 @@ describe('Asset Transfer Proxies', () => {
const ownerFromAsset = await erc721TokenA.ownerOf.callAsync(erc721AFromTokenId);
expect(ownerFromAsset).to.be.equal(fromAddress);
// Remove transfer approval for fromAddress.
await web3Wrapper.awaitTransactionSuccessAsync(
await erc721TokenA.approve.sendTransactionAsync(constants.NULL_ADDRESS, erc721AFromTokenId, {
from: fromAddress,
}),
await erc721TokenA.approve.awaitTransactionSuccessAsync(
constants.NULL_ADDRESS,
erc721AFromTokenId,
{ from: fromAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
// Perform a transfer; expect this to fail.
@@ -944,6 +981,314 @@ describe('Asset Transfer Proxies', () => {
expect(newOwnerFromAsset1).to.be.equal(toAddress);
expect(newOwnerFromAsset2).to.be.equal(toAddress);
});
it('should transfer a fungible ERC1155 token', async () => {
// setup test parameters
const tokenHolders = [fromAddress, toAddress];
const tokensToTransfer = erc1155FungibleTokens.slice(0, 1);
const valuesToTransfer = [new BigNumber(25)];
const valueMultiplier = new BigNumber(23);
const receiverCallbackData = '0x0102030405';
// check balances before transfer
const expectedInitialBalances = [
// from
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
// to
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
];
await erc1155Wrapper.assertBalancesAsync(tokenHolders, tokensToTransfer, expectedInitialBalances);
// encode erc1155 asset data
const erc1155AssetData = assetDataUtils.encodeERC1155AssetData(
erc1155Contract.address,
tokensToTransfer,
valuesToTransfer,
receiverCallbackData,
);
// encode multi-asset data
const multiAssetAmount = new BigNumber(5);
const amounts = [valueMultiplier];
const nestedAssetData = [erc1155AssetData];
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
assetData,
fromAddress,
toAddress,
multiAssetAmount,
);
// execute transfer
await web3Wrapper.awaitTransactionSuccessAsync(
await web3Wrapper.sendTransactionAsync({
to: multiAssetProxy.address,
data,
from: authorized,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
// check balances
const totalValueTransferred = valuesToTransfer[0].times(valueMultiplier).times(multiAssetAmount);
const expectedFinalBalances = [
// from
expectedInitialBalances[0].minus(totalValueTransferred),
// to
expectedInitialBalances[1].plus(totalValueTransferred),
];
await erc1155Wrapper.assertBalancesAsync(tokenHolders, tokensToTransfer, expectedFinalBalances);
});
it('should successfully transfer multiple fungible tokens of the same ERC1155 contract', async () => {
// setup test parameters
const tokenHolders = [fromAddress, toAddress];
const tokensToTransfer = erc1155FungibleTokens.slice(0, 3);
const valuesToTransfer = [new BigNumber(25), new BigNumber(35), new BigNumber(45)];
const valueMultiplier = new BigNumber(23);
const receiverCallbackData = '0x0102030405';
// check balances before transfer
const expectedInitialBalances = [
// from
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
// to
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
];
await erc1155Wrapper.assertBalancesAsync(tokenHolders, tokensToTransfer, expectedInitialBalances);
// encode erc1155 asset data
const erc1155AssetData = assetDataUtils.encodeERC1155AssetData(
erc1155Contract.address,
tokensToTransfer,
valuesToTransfer,
receiverCallbackData,
);
// encode multi-asset data
const multiAssetAmount = new BigNumber(5);
const amounts = [valueMultiplier];
const nestedAssetData = [erc1155AssetData];
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
assetData,
fromAddress,
toAddress,
multiAssetAmount,
);
// execute transfer
await web3Wrapper.awaitTransactionSuccessAsync(
await web3Wrapper.sendTransactionAsync({
to: multiAssetProxy.address,
data,
from: authorized,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
// check balances
const totalValuesTransferred = _.map(valuesToTransfer, (value: BigNumber) => {
return value.times(valueMultiplier).times(multiAssetAmount);
});
const expectedFinalBalances = [
// from
expectedInitialBalances[0].minus(totalValuesTransferred[0]),
expectedInitialBalances[1].minus(totalValuesTransferred[1]),
expectedInitialBalances[2].minus(totalValuesTransferred[2]),
// to
expectedInitialBalances[3].plus(totalValuesTransferred[0]),
expectedInitialBalances[4].plus(totalValuesTransferred[1]),
expectedInitialBalances[5].plus(totalValuesTransferred[2]),
];
await erc1155Wrapper.assertBalancesAsync(tokenHolders, tokensToTransfer, expectedFinalBalances);
});
it('should successfully transfer multiple fungible/non-fungible tokens of the same ERC1155 contract', async () => {
// setup test parameters
const tokenHolders = [fromAddress, toAddress];
const fungibleTokensToTransfer = erc1155FungibleTokens.slice(0, 1);
const nonFungibleTokensToTransfer = erc1155NonFungibleTokensOwnedBySpender.slice(0, 1);
const tokensToTransfer = fungibleTokensToTransfer.concat(nonFungibleTokensToTransfer);
const valuesToTransfer = [new BigNumber(25), new BigNumber(1)];
const valueMultiplier = new BigNumber(1);
const receiverCallbackData = '0x0102030405';
// check balances before transfer
const nftOwnerBalance = new BigNumber(1);
const nftNotOwnerBalance = new BigNumber(0);
const expectedInitialBalances = [
// from
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
nftOwnerBalance,
// to
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
nftNotOwnerBalance,
];
await erc1155Wrapper.assertBalancesAsync(tokenHolders, tokensToTransfer, expectedInitialBalances);
// encode erc1155 asset data
const erc1155AssetData = assetDataUtils.encodeERC1155AssetData(
erc1155Contract.address,
tokensToTransfer,
valuesToTransfer,
receiverCallbackData,
);
// encode multi-asset data
const multiAssetAmount = new BigNumber(1);
const amounts = [valueMultiplier];
const nestedAssetData = [erc1155AssetData];
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
assetData,
fromAddress,
toAddress,
multiAssetAmount,
);
// execute transfer
await web3Wrapper.awaitTransactionSuccessAsync(
await web3Wrapper.sendTransactionAsync({
to: multiAssetProxy.address,
data,
from: authorized,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
// check balances
const totalValuesTransferred = _.map(valuesToTransfer, (value: BigNumber) => {
return value.times(valueMultiplier).times(multiAssetAmount);
});
const expectedFinalBalances = [
// from
expectedInitialBalances[0].minus(totalValuesTransferred[0]),
expectedInitialBalances[1].minus(totalValuesTransferred[1]),
// to
expectedInitialBalances[2].plus(totalValuesTransferred[0]),
expectedInitialBalances[3].plus(totalValuesTransferred[1]),
];
await erc1155Wrapper.assertBalancesAsync(tokenHolders, tokensToTransfer, expectedFinalBalances);
});
it('should successfully transfer multiple different ERC1155 tokens', async () => {
// setup test parameters
const tokenHolders = [fromAddress, toAddress];
const tokensToTransfer = erc1155FungibleTokens.slice(0, 1);
const valuesToTransfer = [new BigNumber(25)];
const valueMultiplier = new BigNumber(23);
const receiverCallbackData = '0x0102030405';
// check balances before transfer
const expectedInitialBalances = [
// from
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
// to
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
];
await erc1155Wrapper.assertBalancesAsync(tokenHolders, tokensToTransfer, expectedInitialBalances);
await erc1155Wrapper2.assertBalancesAsync(tokenHolders, tokensToTransfer, expectedInitialBalances);
// encode erc1155 asset data
const erc1155AssetData1 = assetDataUtils.encodeERC1155AssetData(
erc1155Contract.address,
tokensToTransfer,
valuesToTransfer,
receiverCallbackData,
);
const erc1155AssetData2 = assetDataUtils.encodeERC1155AssetData(
erc1155Contract2.address,
tokensToTransfer,
valuesToTransfer,
receiverCallbackData,
);
// encode multi-asset data
const multiAssetAmount = new BigNumber(5);
const amounts = [valueMultiplier, valueMultiplier];
const nestedAssetData = [erc1155AssetData1, erc1155AssetData2];
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
assetData,
fromAddress,
toAddress,
multiAssetAmount,
);
// execute transfer
await web3Wrapper.awaitTransactionSuccessAsync(
await web3Wrapper.sendTransactionAsync({
to: multiAssetProxy.address,
data,
from: authorized,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
// check balances
const totalValueTransferred = valuesToTransfer[0].times(valueMultiplier).times(multiAssetAmount);
const expectedFinalBalances = [
// from
expectedInitialBalances[0].minus(totalValueTransferred),
// to
expectedInitialBalances[1].plus(totalValueTransferred),
];
await erc1155Wrapper.assertBalancesAsync(tokenHolders, tokensToTransfer, expectedFinalBalances);
await erc1155Wrapper2.assertBalancesAsync(tokenHolders, tokensToTransfer, expectedFinalBalances);
});
it('should successfully transfer a combination of ERC20, ERC721, and ERC1155 tokens', 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 erc1155TokenHolders = [fromAddress, toAddress];
const erc1155TokensToTransfer = erc1155FungibleTokens.slice(0, 1);
const erc1155ValuesToTransfer = [new BigNumber(25)];
const erc1155Amount = new BigNumber(23);
const erc1155ReceiverCallbackData = '0x0102030405';
const erc1155AssetData = assetDataUtils.encodeERC1155AssetData(
erc1155Contract.address,
erc1155TokensToTransfer,
erc1155ValuesToTransfer,
erc1155ReceiverCallbackData,
);
const amounts = [erc20Amount, erc721Amount, erc1155Amount];
const nestedAssetData = [erc20AssetData, erc721AssetData, erc1155AssetData];
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
assetData,
fromAddress,
toAddress,
inputAmount,
);
// check balances before transfer
const erc20Balances = await erc20Wrapper.getBalancesAsync();
const ownerFromAsset = await erc721TokenA.ownerOf.callAsync(erc721AFromTokenId);
expect(ownerFromAsset).to.be.equal(fromAddress);
const erc1155ExpectedInitialBalances = [
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
];
await erc1155Wrapper.assertBalancesAsync(
erc1155TokenHolders,
erc1155TokensToTransfer,
erc1155ExpectedInitialBalances,
);
// execute transfer
await web3Wrapper.awaitTransactionSuccessAsync(
await web3Wrapper.sendTransactionAsync({
to: multiAssetProxy.address,
data,
from: authorized,
gas: 1000000,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
// check balances after transfer
const newBalances = await erc20Wrapper.getBalancesAsync();
const totalAmount = inputAmount.times(erc20Amount);
expect(newBalances[fromAddress][erc20TokenA.address]).to.be.bignumber.equal(
erc20Balances[fromAddress][erc20TokenA.address].minus(totalAmount),
);
expect(newBalances[toAddress][erc20TokenA.address]).to.be.bignumber.equal(
erc20Balances[toAddress][erc20TokenA.address].plus(totalAmount),
);
const newOwnerFromAsset = await erc721TokenA.ownerOf.callAsync(erc721AFromTokenId);
expect(newOwnerFromAsset).to.be.equal(toAddress);
const erc1155TotalValueTransferred = erc1155ValuesToTransfer[0].times(erc1155Amount).times(inputAmount);
const expectedFinalBalances = [
erc1155ExpectedInitialBalances[0].minus(erc1155TotalValueTransferred),
erc1155ExpectedInitialBalances[1].plus(erc1155TotalValueTransferred),
];
await erc1155Wrapper.assertBalancesAsync(
erc1155TokenHolders,
erc1155TokensToTransfer,
expectedFinalBalances,
);
});
it('should successfully transfer a combination of ERC20 and ERC721 tokens', async () => {
const inputAmount = new BigNumber(1);
const erc20Amount = new BigNumber(10);
@@ -989,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,
@@ -1284,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

@@ -0,0 +1,242 @@
import {
chaiSetup,
constants,
expectTransactionFailedAsync,
expectTransactionFailedWithoutReasonAsync,
provider,
txDefaults,
web3Wrapper,
} from '@0x/contracts-test-utils';
import { BlockchainLifecycle } from '@0x/dev-utils';
import { assetDataUtils } from '@0x/order-utils';
import { AssetProxyId, RevertReason } from '@0x/types';
import { AbiEncoder, BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as ethUtil from 'ethereumjs-util';
import { artifacts, IAssetProxyContract, StaticCallProxyContract, TestStaticCallTargetContract } from '../src';
chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
describe('StaticCallProxy', () => {
const amount = constants.ZERO_AMOUNT;
let fromAddress: string;
let toAddress: string;
let staticCallProxy: IAssetProxyContract;
let staticCallTarget: TestStaticCallTargetContract;
before(async () => {
await blockchainLifecycle.startAsync();
});
after(async () => {
await blockchainLifecycle.revertAsync();
});
before(async () => {
const accounts = await web3Wrapper.getAvailableAddressesAsync();
[fromAddress, toAddress] = accounts.slice(0, 2);
const staticCallProxyWithoutTransferFrom = await StaticCallProxyContract.deployFrom0xArtifactAsync(
artifacts.StaticCallProxy,
provider,
txDefaults,
artifacts,
);
staticCallProxy = new IAssetProxyContract(staticCallProxyWithoutTransferFrom.address, provider, txDefaults);
staticCallTarget = await TestStaticCallTargetContract.deployFrom0xArtifactAsync(
artifacts.TestStaticCallTarget,
provider,
txDefaults,
artifacts,
);
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();
});
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
describe('general', () => {
it('should revert if undefined function is called', async () => {
const undefinedSelector = '0x01020304';
await expectTransactionFailedWithoutReasonAsync(
web3Wrapper.sendTransactionAsync({
from: fromAddress,
to: staticCallProxy.address,
value: constants.ZERO_AMOUNT,
data: undefinedSelector,
}),
);
});
it('should have an id of 0xc339d10a', async () => {
const proxyId = await staticCallProxy.getProxyId.callAsync();
const expectedProxyId = AssetProxyId.StaticCall;
expect(proxyId).to.equal(expectedProxyId);
});
});
describe('transferFrom', () => {
it('should revert if assetData lies outside the bounds of calldata', async () => {
const staticCallData = staticCallTarget.noInputFunction.getABIEncodedTransactionData();
const expectedResultHash = constants.KECCAK256_NULL;
const assetData = assetDataUtils.encodeStaticCallAssetData(
staticCallTarget.address,
staticCallData,
expectedResultHash,
);
const txData = staticCallProxy.transferFrom.getABIEncodedTransactionData(
assetData,
fromAddress,
toAddress,
amount,
);
const offsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000080';
const txDataEndBuffer = ethUtil.toBuffer((txData.length - 2) / 2 - 4);
const paddedTxDataEndBuffer = ethUtil.setLengthLeft(txDataEndBuffer, 32);
const invalidOffsetToAssetData = ethUtil.bufferToHex(paddedTxDataEndBuffer).slice(2);
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
const badTxData = `${txData.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
await expectTransactionFailedWithoutReasonAsync(
web3Wrapper.sendTransactionAsync({
to: staticCallProxy.address,
from: fromAddress,
data: badTxData,
}),
);
});
it('should revert if the length of assetData is less than 100 bytes', async () => {
const staticCallData = constants.NULL_BYTES;
const expectedResultHash = constants.KECCAK256_NULL;
const assetData = assetDataUtils
.encodeStaticCallAssetData(staticCallTarget.address, staticCallData, expectedResultHash)
.slice(0, -128);
const assetDataByteLen = (assetData.length - 2) / 2;
expect((assetDataByteLen - 4) % 32).to.equal(0);
await expectTransactionFailedWithoutReasonAsync(
staticCallProxy.transferFrom.sendTransactionAsync(assetData, fromAddress, toAddress, amount),
);
});
it('should revert if the offset to `staticCallData` points to outside of assetData', async () => {
const staticCallData = staticCallTarget.noInputFunction.getABIEncodedTransactionData();
const expectedResultHash = constants.KECCAK256_NULL;
const assetData = assetDataUtils.encodeStaticCallAssetData(
staticCallTarget.address,
staticCallData,
expectedResultHash,
);
const offsetToStaticCallData = '0000000000000000000000000000000000000000000000000000000000000060';
const assetDataEndBuffer = ethUtil.toBuffer((assetData.length - 2) / 2 - 4);
const paddedAssetDataEndBuffer = ethUtil.setLengthLeft(assetDataEndBuffer, 32);
const invalidOffsetToStaticCallData = ethUtil.bufferToHex(paddedAssetDataEndBuffer).slice(2);
const newStaticCallData = '0000000000000000000000000000000000000000000000000000000000000304';
const badAssetData = `${assetData.replace(
offsetToStaticCallData,
invalidOffsetToStaticCallData,
)}${newStaticCallData}`;
await expectTransactionFailedWithoutReasonAsync(
staticCallProxy.transferFrom.sendTransactionAsync(badAssetData, fromAddress, toAddress, amount),
);
});
it('should revert if the callTarget attempts to write to state', async () => {
const staticCallData = staticCallTarget.updateState.getABIEncodedTransactionData();
const expectedResultHash = constants.KECCAK256_NULL;
const assetData = assetDataUtils.encodeStaticCallAssetData(
staticCallTarget.address,
staticCallData,
expectedResultHash,
);
await expectTransactionFailedWithoutReasonAsync(
staticCallProxy.transferFrom.sendTransactionAsync(assetData, fromAddress, toAddress, amount),
);
});
it('should revert with data provided by the callTarget if the staticcall reverts', async () => {
const staticCallData = staticCallTarget.assertEvenNumber.getABIEncodedTransactionData(new BigNumber(1));
const expectedResultHash = constants.KECCAK256_NULL;
const assetData = assetDataUtils.encodeStaticCallAssetData(
staticCallTarget.address,
staticCallData,
expectedResultHash,
);
await expectTransactionFailedAsync(
staticCallProxy.transferFrom.sendTransactionAsync(assetData, fromAddress, toAddress, amount),
RevertReason.TargetNotEven,
);
});
it('should revert if the hash of the output is different than expected expected', async () => {
const staticCallData = staticCallTarget.isOddNumber.getABIEncodedTransactionData(new BigNumber(0));
const trueAsBuffer = ethUtil.toBuffer('0x0000000000000000000000000000000000000000000000000000000000000001');
const expectedResultHash = ethUtil.bufferToHex(ethUtil.sha3(trueAsBuffer));
const assetData = assetDataUtils.encodeStaticCallAssetData(
staticCallTarget.address,
staticCallData,
expectedResultHash,
);
await expectTransactionFailedAsync(
staticCallProxy.transferFrom.sendTransactionAsync(assetData, fromAddress, toAddress, amount),
RevertReason.UnexpectedStaticCallResult,
);
});
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(
staticCallTarget.address,
staticCallData,
expectedResultHash,
);
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');
const expectedResultHash = ethUtil.bufferToHex(ethUtil.sha3(trueAsBuffer));
const assetData = assetDataUtils.encodeStaticCallAssetData(
staticCallTarget.address,
staticCallData,
expectedResultHash,
);
await staticCallProxy.transferFrom.awaitTransactionSuccessAsync(assetData, fromAddress, toAddress, amount);
});
it('should be successful if a function with one dynamic input is successful', async () => {
const dynamicInput = '0x0102030405060708';
const staticCallData = staticCallTarget.dynamicInputFunction.getABIEncodedTransactionData(dynamicInput);
const expectedResultHash = constants.KECCAK256_NULL;
const assetData = assetDataUtils.encodeStaticCallAssetData(
staticCallTarget.address,
staticCallData,
expectedResultHash,
);
await staticCallProxy.transferFrom.awaitTransactionSuccessAsync(assetData, fromAddress, toAddress, amount);
});
it('should be successful if a function call returns a complex type', async () => {
const a = new BigNumber(1);
const b = new BigNumber(2);
const staticCallData = staticCallTarget.returnComplexType.getABIEncodedTransactionData(a, b);
const abiEncoder = new AbiEncoder.DynamicBytes({
name: '',
type: 'bytes',
});
const aHex = '0000000000000000000000000000000000000000000000000000000000000001';
const bHex = '0000000000000000000000000000000000000000000000000000000000000002';
const expectedResults = `${staticCallTarget.address}${aHex}${bHex}`;
const offset = '0000000000000000000000000000000000000000000000000000000000000020';
const encodedExpectedResultWithOffset = `0x${offset}${abiEncoder.encode(expectedResults).slice(2)}`;
const expectedResultHash = ethUtil.bufferToHex(
ethUtil.sha3(ethUtil.toBuffer(encodedExpectedResultWithOffset)),
);
const assetData = assetDataUtils.encodeStaticCallAssetData(
staticCallTarget.address,
staticCallData,
expectedResultHash,
);
await staticCallProxy.transferFrom.awaitTransactionSuccessAsync(assetData, fromAddress, toAddress, amount);
});
});
});

View File

@@ -0,0 +1,403 @@
import { artifacts as erc1155Artifacts, ERC1155MintableContract, Erc1155Wrapper } from '@0x/contracts-erc1155';
import {
constants,
ERC1155FungibleHoldingsByOwner,
ERC1155HoldingsByOwner,
ERC1155NonFungibleHoldingsByOwner,
LogDecoder,
txDefaults,
} from '@0x/contracts-test-utils';
import { assetDataUtils } from '@0x/order-utils';
import { BigNumber } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import * as _ from 'lodash';
import { artifacts, ERC1155ProxyContract, IAssetProxyContract } from '../../src';
export class ERC1155ProxyWrapper {
private readonly _tokenOwnerAddresses: string[];
private readonly _fungibleTokenIds: string[];
private readonly _nonFungibleTokenIds: string[];
private readonly _nfts: Array<{ id: BigNumber; tokenId: BigNumber }>;
private readonly _contractOwnerAddress: string;
private readonly _web3Wrapper: Web3Wrapper;
private readonly _provider: Provider;
private readonly _logDecoder: LogDecoder;
private readonly _dummyTokenWrappers: Erc1155Wrapper[];
private readonly _assetProxyInterface: IAssetProxyContract;
private _proxyContract?: ERC1155ProxyContract;
private _proxyIdIfExists?: string;
private _initialTokenIdsByOwner: ERC1155HoldingsByOwner = { fungible: {}, nonFungible: {} };
constructor(provider: Provider, tokenOwnerAddresses: string[], contractOwnerAddress: string) {
this._web3Wrapper = new Web3Wrapper(provider);
this._provider = provider;
const allArtifacts = _.merge(artifacts, erc1155Artifacts);
this._logDecoder = new LogDecoder(this._web3Wrapper, allArtifacts);
this._dummyTokenWrappers = [];
this._assetProxyInterface = new IAssetProxyContract(constants.NULL_ADDRESS, provider);
this._tokenOwnerAddresses = tokenOwnerAddresses;
this._contractOwnerAddress = contractOwnerAddress;
this._fungibleTokenIds = [];
this._nonFungibleTokenIds = [];
this._nfts = [];
}
/**
* @dev Deploys dummy ERC1155 contracts
* @return An array of ERC1155 wrappers; one for each deployed contract.
*/
public async deployDummyContractsAsync(): Promise<Erc1155Wrapper[]> {
// tslint:disable-next-line:no-unused-variable
for (const i of _.times(constants.NUM_DUMMY_ERC1155_CONTRACTS_TO_DEPLOY)) {
const erc1155Contract = await ERC1155MintableContract.deployFrom0xArtifactAsync(
erc1155Artifacts.ERC1155Mintable,
this._provider,
txDefaults,
artifacts,
);
const erc1155Wrapper = new Erc1155Wrapper(erc1155Contract, this._provider, this._contractOwnerAddress);
this._dummyTokenWrappers.push(erc1155Wrapper);
}
return this._dummyTokenWrappers;
}
/**
* @dev Deploys the ERC1155 proxy
* @return Deployed ERC1155 proxy contract instance
*/
public async deployProxyAsync(): Promise<ERC1155ProxyContract> {
this._proxyContract = await ERC1155ProxyContract.deployFrom0xArtifactAsync(
artifacts.ERC1155Proxy,
this._provider,
txDefaults,
artifacts,
);
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
return this._proxyContract;
}
/**
* @dev Gets the ERC1155 proxy id
*/
public getProxyId(): string {
this._validateProxyContractExistsOrThrow();
return this._proxyIdIfExists as string;
}
/**
* @dev generates abi-encoded tx data for transferring erc1155 fungible/non-fungible tokens.
* @param from source address
* @param to destination address
* @param contractAddress address of erc155 contract
* @param tokensToTransfer array of erc1155 tokens to transfer
* @param valuesToTransfer array of corresponding values for each erc1155 token to transfer
* @param valueMultiplier each value in `valuesToTransfer` is multiplied by this
* @param receiverCallbackData callback data if `to` is a contract
* @param authorizedSender sender of `transferFrom` transaction
* @param extraData extra data to append to `transferFrom` transaction. Optional.
* @return abi encoded tx data.
*/
public getTransferFromAbiEncodedTxData(
from: string,
to: string,
contractAddress: string,
tokensToTransfer: BigNumber[],
valuesToTransfer: BigNumber[],
valueMultiplier: BigNumber,
receiverCallbackData: string,
authorizedSender: string,
assetData_?: string,
): string {
this._validateProxyContractExistsOrThrow();
const assetData =
assetData_ === undefined
? assetDataUtils.encodeERC1155AssetData(
contractAddress,
tokensToTransfer,
valuesToTransfer,
receiverCallbackData,
)
: assetData_;
const data = this._assetProxyInterface.transferFrom.getABIEncodedTransactionData(
assetData,
from,
to,
valueMultiplier,
);
return data;
}
/**
* @dev transfers erc1155 fungible/non-fungible tokens.
* @param txData: abi-encoded tx data
* @param authorizedSender sender of `transferFrom` transaction
*/
public async transferFromRawAsync(
txData: string,
authorizedSender: string,
): Promise<TransactionReceiptWithDecodedLogs> {
const txHash = await this._web3Wrapper.sendTransactionAsync({
to: (this._proxyContract as ERC1155ProxyContract).address,
data: txData,
from: authorizedSender,
gas: 300000,
});
const txReceipt = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
return txReceipt;
}
/**
* @dev transfers erc1155 fungible/non-fungible tokens.
* @param from source address
* @param to destination address
* @param contractAddress address of erc155 contract
* @param tokensToTransfer array of erc1155 tokens to transfer
* @param valuesToTransfer array of corresponding values for each erc1155 token to transfer
* @param valueMultiplier each value in `valuesToTransfer` is multiplied by this
* @param receiverCallbackData callback data if `to` is a contract
* @param authorizedSender sender of `transferFrom` transaction
* @param extraData extra data to append to `transferFrom` transaction. Optional.
* @return tranasction hash.
*/
public async transferFromAsync(
from: string,
to: string,
contractAddress: string,
tokensToTransfer: BigNumber[],
valuesToTransfer: BigNumber[],
valueMultiplier: BigNumber,
receiverCallbackData: string,
authorizedSender: string,
assetData_?: string,
): Promise<TransactionReceiptWithDecodedLogs> {
this._validateProxyContractExistsOrThrow();
const assetData =
assetData_ === undefined
? assetDataUtils.encodeERC1155AssetData(
contractAddress,
tokensToTransfer,
valuesToTransfer,
receiverCallbackData,
)
: assetData_;
const data = this._assetProxyInterface.transferFrom.getABIEncodedTransactionData(
assetData,
from,
to,
valueMultiplier,
);
const txHash = await this._web3Wrapper.sendTransactionAsync({
to: (this._proxyContract as ERC1155ProxyContract).address,
data,
from: authorizedSender,
gas: 300000,
});
const txReceipt = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
return txReceipt;
}
/**
* @dev For each deployed ERC1155 contract, this function mints a set of fungible/non-fungible
* tokens for each token owner address (`_tokenOwnerAddresses`).
* @return Balances of each token owner, across all ERC1155 contracts and tokens.
*/
public async setBalancesAndAllowancesAsync(): Promise<ERC1155HoldingsByOwner> {
this._validateDummyTokenContractsExistOrThrow();
this._validateProxyContractExistsOrThrow();
this._initialTokenIdsByOwner = {
fungible: {},
nonFungible: {},
};
const fungibleHoldingsByOwner: ERC1155FungibleHoldingsByOwner = {};
const nonFungibleHoldingsByOwner: ERC1155NonFungibleHoldingsByOwner = {};
// Set balances accordingly
for (const dummyWrapper of this._dummyTokenWrappers) {
const dummyAddress = dummyWrapper.getContract().address;
// tslint:disable-next-line:no-unused-variable
for (const i of _.times(constants.NUM_ERC1155_FUNGIBLE_TOKENS_MINT)) {
// Create a fungible token
const tokenId = await dummyWrapper.mintFungibleTokensAsync(
this._tokenOwnerAddresses,
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
);
const tokenIdAsString = tokenId.toString();
this._fungibleTokenIds.push(tokenIdAsString);
// Mint tokens for each owner for this token
for (const tokenOwnerAddress of this._tokenOwnerAddresses) {
// tslint:disable-next-line:no-unused-variable
if (fungibleHoldingsByOwner[tokenOwnerAddress] === undefined) {
fungibleHoldingsByOwner[tokenOwnerAddress] = {};
}
if (fungibleHoldingsByOwner[tokenOwnerAddress][dummyAddress] === undefined) {
fungibleHoldingsByOwner[tokenOwnerAddress][dummyAddress] = {};
}
fungibleHoldingsByOwner[tokenOwnerAddress][dummyAddress][tokenIdAsString] =
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE;
await dummyWrapper.setApprovalForAllAsync(
tokenOwnerAddress,
(this._proxyContract as ERC1155ProxyContract).address,
true,
);
}
}
// Non-fungible tokens
// tslint:disable-next-line:no-unused-variable
for (const j of _.times(constants.NUM_ERC1155_NONFUNGIBLE_TOKENS_MINT)) {
const [tokenId, nftIds] = await dummyWrapper.mintNonFungibleTokensAsync(this._tokenOwnerAddresses);
const tokenIdAsString = tokenId.toString();
this._nonFungibleTokenIds.push(tokenIdAsString);
_.each(this._tokenOwnerAddresses, async (tokenOwnerAddress: string, i: number) => {
if (nonFungibleHoldingsByOwner[tokenOwnerAddress] === undefined) {
nonFungibleHoldingsByOwner[tokenOwnerAddress] = {};
}
if (nonFungibleHoldingsByOwner[tokenOwnerAddress][dummyAddress] === undefined) {
nonFungibleHoldingsByOwner[tokenOwnerAddress][dummyAddress] = {};
}
if (nonFungibleHoldingsByOwner[tokenOwnerAddress][dummyAddress][tokenIdAsString] === undefined) {
nonFungibleHoldingsByOwner[tokenOwnerAddress][dummyAddress][tokenIdAsString] = [];
}
this._nfts.push({ id: nftIds[i], tokenId });
nonFungibleHoldingsByOwner[tokenOwnerAddress][dummyAddress][tokenIdAsString].push(nftIds[i]);
await dummyWrapper.setApprovalForAllAsync(
tokenOwnerAddress,
(this._proxyContract as ERC1155ProxyContract).address,
true,
);
});
}
}
this._initialTokenIdsByOwner = {
fungible: fungibleHoldingsByOwner,
nonFungible: nonFungibleHoldingsByOwner,
};
return this._initialTokenIdsByOwner;
}
/**
* @dev For each deployed ERC1155 contract, this function quieries the set of fungible/non-fungible
* tokens for each token owner address (`_tokenOwnerAddresses`).
* @return Balances of each token owner, across all ERC1155 contracts and tokens.
*/
public async getBalancesAsync(): Promise<ERC1155HoldingsByOwner> {
this._validateDummyTokenContractsExistOrThrow();
this._validateBalancesAndAllowancesSetOrThrow();
const tokenHoldingsByOwner: ERC1155FungibleHoldingsByOwner = {};
const nonFungibleHoldingsByOwner: ERC1155NonFungibleHoldingsByOwner = {};
for (const dummyTokenWrapper of this._dummyTokenWrappers) {
const tokenContract = dummyTokenWrapper.getContract();
const tokenAddress = tokenContract.address;
// Construct batch balance call
const tokenOwners: string[] = [];
const tokenIds: BigNumber[] = [];
for (const tokenOwnerAddress of this._tokenOwnerAddresses) {
for (const tokenId of this._fungibleTokenIds) {
tokenOwners.push(tokenOwnerAddress);
tokenIds.push(new BigNumber(tokenId));
}
for (const nft of this._nfts) {
tokenOwners.push(tokenOwnerAddress);
tokenIds.push(nft.id);
}
}
const balances = await dummyTokenWrapper.getBalancesAsync(tokenOwners, tokenIds);
// Parse out balances into fungible / non-fungible token holdings
let i = 0;
for (const tokenOwnerAddress of this._tokenOwnerAddresses) {
// Fungible tokens
for (const tokenId of this._fungibleTokenIds) {
if (tokenHoldingsByOwner[tokenOwnerAddress] === undefined) {
tokenHoldingsByOwner[tokenOwnerAddress] = {};
}
if (tokenHoldingsByOwner[tokenOwnerAddress][tokenAddress] === undefined) {
tokenHoldingsByOwner[tokenOwnerAddress][tokenAddress] = {};
}
tokenHoldingsByOwner[tokenOwnerAddress][tokenAddress][tokenId] = balances[i++];
}
// Non-fungible tokens
for (const nft of this._nfts) {
if (nonFungibleHoldingsByOwner[tokenOwnerAddress] === undefined) {
nonFungibleHoldingsByOwner[tokenOwnerAddress] = {};
}
if (nonFungibleHoldingsByOwner[tokenOwnerAddress][tokenAddress] === undefined) {
nonFungibleHoldingsByOwner[tokenOwnerAddress][tokenAddress] = {};
}
if (
nonFungibleHoldingsByOwner[tokenOwnerAddress][tokenAddress][nft.tokenId.toString()] ===
undefined
) {
nonFungibleHoldingsByOwner[tokenOwnerAddress][tokenAddress][nft.tokenId.toString()] = [];
}
const isOwner = balances[i++];
if (isOwner.isEqualTo(1)) {
nonFungibleHoldingsByOwner[tokenOwnerAddress][tokenAddress][nft.tokenId.toString()].push(
nft.id,
);
}
}
}
}
const holdingsByOwner = {
fungible: tokenHoldingsByOwner,
nonFungible: nonFungibleHoldingsByOwner,
};
return holdingsByOwner;
}
/**
* @dev Checks if proxy is approved to transfer tokens on behalf of `userAddress`.
* @param userAddress owner of ERC1155 tokens.
* @param contractAddress address of ERC1155 contract.
* @return True iff the proxy is approved for all. False otherwise.
*/
public async isProxyApprovedForAllAsync(userAddress: string, contractAddress: string): Promise<boolean> {
this._validateProxyContractExistsOrThrow();
const tokenContract = this._getContractFromAddress(contractAddress);
const operator = (this._proxyContract as ERC1155ProxyContract).address;
const didApproveAll = await tokenContract.isApprovedForAll.callAsync(userAddress, operator);
return didApproveAll;
}
public getFungibleTokenIds(): BigNumber[] {
const fungibleTokenIds = _.map(this._fungibleTokenIds, (tokenIdAsString: string) => {
return new BigNumber(tokenIdAsString);
});
return fungibleTokenIds;
}
public getNonFungibleTokenIds(): BigNumber[] {
const nonFungibleTokenIds = _.map(this._nonFungibleTokenIds, (tokenIdAsString: string) => {
return new BigNumber(tokenIdAsString);
});
return nonFungibleTokenIds;
}
public getTokenOwnerAddresses(): string[] {
return this._tokenOwnerAddresses;
}
public getContractWrapper(contractAddress: string): Erc1155Wrapper {
const tokenWrapper = _.find(this._dummyTokenWrappers, (wrapper: Erc1155Wrapper) => {
return wrapper.getContract().address === contractAddress;
});
if (tokenWrapper === undefined) {
throw new Error(`Contract: ${contractAddress} was not deployed through ERC1155ProxyWrapper`);
}
return tokenWrapper;
}
private _getContractFromAddress(tokenAddress: string): ERC1155MintableContract {
const tokenContractIfExists = _.find(this._dummyTokenWrappers, c => c.getContract().address === tokenAddress);
if (tokenContractIfExists === undefined) {
throw new Error(`Token: ${tokenAddress} was not deployed through ERC1155ProxyWrapper`);
}
return tokenContractIfExists.getContract();
}
private _validateDummyTokenContractsExistOrThrow(): void {
if (this._dummyTokenWrappers === undefined) {
throw new Error('Dummy ERC1155 tokens not yet deployed, please call "deployDummyTokensAsync"');
}
}
private _validateProxyContractExistsOrThrow(): void {
if (this._proxyContract === undefined) {
throw new Error('ERC1155 proxy contract not yet deployed, please call "deployProxyAsync"');
}
}
private _validateBalancesAndAllowancesSetOrThrow(): void {
if (
_.keys(this._initialTokenIdsByOwner.fungible).length === 0 ||
_.keys(this._initialTokenIdsByOwner.nonFungible).length === 0
) {
throw new Error(
'Dummy ERC1155 balances and allowances not yet set, please call "setBalancesAndAllowancesAsync"',
);
}
}
}

View File

@@ -1,19 +1,16 @@
import { artifacts as tokensArtifacts, DummyERC20TokenContract } from '@0x/contracts-erc20';
import { artifacts as erc20Artifacts, DummyERC20TokenContract } from '@0x/contracts-erc20';
import { constants, ERC20BalancesByOwner, txDefaults } from '@0x/contracts-test-utils';
import { assetDataUtils } from '@0x/order-utils';
import { BigNumber } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
import { ZeroExProvider } from 'ethereum-types';
import * as _ from 'lodash';
import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy';
import { artifacts } from '../../src/artifacts';
import { artifacts, ERC20ProxyContract } from '../../src';
export class ERC20Wrapper {
private readonly _tokenOwnerAddresses: string[];
private readonly _contractOwnerAddress: string;
private readonly _web3Wrapper: Web3Wrapper;
private readonly _provider: Provider;
private readonly _provider: ZeroExProvider;
private readonly _dummyTokenContracts: DummyERC20TokenContract[];
private _proxyContract?: ERC20ProxyContract;
private _proxyIdIfExists?: string;
@@ -24,9 +21,8 @@ export class ERC20Wrapper {
* @param contractOwnerAddress Desired owner of the contract
* Instance of ERC20Wrapper
*/
constructor(provider: Provider, tokenOwnerAddresses: string[], contractOwnerAddress: string) {
constructor(provider: ZeroExProvider, tokenOwnerAddresses: string[], contractOwnerAddress: string) {
this._dummyTokenContracts = [];
this._web3Wrapper = new Web3Wrapper(provider);
this._provider = provider;
this._tokenOwnerAddresses = tokenOwnerAddresses;
this._contractOwnerAddress = contractOwnerAddress;
@@ -38,9 +34,10 @@ export class ERC20Wrapper {
for (let i = 0; i < numberToDeploy; i++) {
this._dummyTokenContracts.push(
await DummyERC20TokenContract.deployFrom0xArtifactAsync(
tokensArtifacts.DummyERC20Token,
erc20Artifacts.DummyERC20Token,
this._provider,
txDefaults,
artifacts,
constants.DUMMY_TOKEN_NAME,
constants.DUMMY_TOKEN_SYMBOL,
decimals,
@@ -55,6 +52,7 @@ export class ERC20Wrapper {
artifacts.ERC20Proxy,
this._provider,
txDefaults,
artifacts,
);
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
return this._proxyContract;
@@ -68,20 +66,16 @@ export class ERC20Wrapper {
this._validateProxyContractExistsOrThrow();
for (const dummyTokenContract of this._dummyTokenContracts) {
for (const tokenOwnerAddress of this._tokenOwnerAddresses) {
await this._web3Wrapper.awaitTransactionSuccessAsync(
await dummyTokenContract.setBalance.sendTransactionAsync(
tokenOwnerAddress,
constants.INITIAL_ERC20_BALANCE,
{ from: this._contractOwnerAddress },
),
await dummyTokenContract.setBalance.awaitTransactionSuccessAsync(
tokenOwnerAddress,
constants.INITIAL_ERC20_BALANCE,
{ from: this._contractOwnerAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
await this._web3Wrapper.awaitTransactionSuccessAsync(
await dummyTokenContract.approve.sendTransactionAsync(
(this._proxyContract as ERC20ProxyContract).address,
constants.INITIAL_ERC20_ALLOWANCE,
{ from: tokenOwnerAddress },
),
await dummyTokenContract.approve.awaitTransactionSuccessAsync(
(this._proxyContract as ERC20ProxyContract).address,
constants.INITIAL_ERC20_ALLOWANCE,
{ from: tokenOwnerAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
}
@@ -94,10 +88,10 @@ export class ERC20Wrapper {
}
public async setBalanceAsync(userAddress: string, assetData: string, amount: BigNumber): Promise<void> {
const tokenContract = this._getTokenContractFromAssetData(assetData);
await this._web3Wrapper.awaitTransactionSuccessAsync(
await tokenContract.setBalance.sendTransactionAsync(userAddress, amount, {
from: this._contractOwnerAddress,
}),
await tokenContract.setBalance.awaitTransactionSuccessAsync(
userAddress,
amount,
{ from: this._contractOwnerAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
}
@@ -110,10 +104,10 @@ export class ERC20Wrapper {
public async setAllowanceAsync(userAddress: string, assetData: string, amount: BigNumber): Promise<void> {
const tokenContract = this._getTokenContractFromAssetData(assetData);
const proxyAddress = (this._proxyContract as ERC20ProxyContract).address;
await this._web3Wrapper.awaitTransactionSuccessAsync(
await tokenContract.approve.sendTransactionAsync(proxyAddress, amount, {
from: userAddress,
}),
await tokenContract.approve.awaitTransactionSuccessAsync(
proxyAddress,
amount,
{ from: userAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
}
@@ -134,7 +128,7 @@ export class ERC20Wrapper {
_.forEach(balances, (balance, balanceIndex) => {
const tokenAddress = balanceInfo[balanceIndex].tokenAddress;
const tokenOwnerAddress = balanceInfo[balanceIndex].tokenOwnerAddress;
if (_.isUndefined(balancesByOwner[tokenOwnerAddress])) {
if (balancesByOwner[tokenOwnerAddress] === undefined) {
balancesByOwner[tokenOwnerAddress] = {};
}
const wrappedBalance = new BigNumber(balance);
@@ -143,7 +137,7 @@ export class ERC20Wrapper {
return balancesByOwner;
}
public addDummyTokenContract(dummy: DummyERC20TokenContract): void {
if (!_.isUndefined(this._dummyTokenContracts)) {
if (this._dummyTokenContracts !== undefined) {
this._dummyTokenContracts.push(dummy);
}
}
@@ -161,18 +155,18 @@ export class ERC20Wrapper {
const erc20ProxyData = assetDataUtils.decodeERC20AssetData(assetData);
const tokenAddress = erc20ProxyData.tokenAddress;
const tokenContractIfExists = _.find(this._dummyTokenContracts, c => c.address === tokenAddress);
if (_.isUndefined(tokenContractIfExists)) {
if (tokenContractIfExists === undefined) {
throw new Error(`Token: ${tokenAddress} was not deployed through ERC20Wrapper`);
}
return tokenContractIfExists;
}
private _validateDummyTokenContractsExistOrThrow(): void {
if (_.isUndefined(this._dummyTokenContracts)) {
if (this._dummyTokenContracts === undefined) {
throw new Error('Dummy ERC20 tokens not yet deployed, please call "deployDummyTokensAsync"');
}
}
private _validateProxyContractExistsOrThrow(): void {
if (_.isUndefined(this._proxyContract)) {
if (this._proxyContract === undefined) {
throw new Error('ERC20 proxy contract not yet deployed, please call "deployProxyAsync"');
}
}

View File

@@ -1,25 +1,21 @@
import { artifacts as tokensArtifacts, DummyERC721TokenContract } from '@0x/contracts-erc721';
import { artifacts as erc721Artifacts, DummyERC721TokenContract } from '@0x/contracts-erc721';
import { constants, ERC721TokenIdsByOwner, txDefaults } from '@0x/contracts-test-utils';
import { generatePseudoRandomSalt } from '@0x/order-utils';
import { BigNumber } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { Provider } from 'ethereum-types';
import { ZeroExProvider } from 'ethereum-types';
import * as _ from 'lodash';
import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy';
import { artifacts } from '../../src/artifacts';
import { artifacts, ERC721ProxyContract } from '../../src';
export class ERC721Wrapper {
private readonly _tokenOwnerAddresses: string[];
private readonly _contractOwnerAddress: string;
private readonly _web3Wrapper: Web3Wrapper;
private readonly _provider: Provider;
private readonly _provider: ZeroExProvider;
private readonly _dummyTokenContracts: DummyERC721TokenContract[];
private _proxyContract?: ERC721ProxyContract;
private _proxyIdIfExists?: string;
private _initialTokenIdsByOwner: ERC721TokenIdsByOwner = {};
constructor(provider: Provider, tokenOwnerAddresses: string[], contractOwnerAddress: string) {
this._web3Wrapper = new Web3Wrapper(provider);
constructor(provider: ZeroExProvider, tokenOwnerAddresses: string[], contractOwnerAddress: string) {
this._provider = provider;
this._dummyTokenContracts = [];
this._tokenOwnerAddresses = tokenOwnerAddresses;
@@ -30,9 +26,10 @@ export class ERC721Wrapper {
for (const i of _.times(constants.NUM_DUMMY_ERC721_TO_DEPLOY)) {
this._dummyTokenContracts.push(
await DummyERC721TokenContract.deployFrom0xArtifactAsync(
tokensArtifacts.DummyERC721Token,
erc721Artifacts.DummyERC721Token,
this._provider,
txDefaults,
artifacts,
constants.DUMMY_TOKEN_NAME,
constants.DUMMY_TOKEN_SYMBOL,
),
@@ -45,6 +42,7 @@ export class ERC721Wrapper {
artifacts.ERC721Proxy,
this._provider,
txDefaults,
artifacts,
);
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
return this._proxyContract;
@@ -63,12 +61,12 @@ export class ERC721Wrapper {
for (const i of _.times(constants.NUM_ERC721_TOKENS_TO_MINT)) {
const tokenId = generatePseudoRandomSalt();
await this.mintAsync(dummyTokenContract.address, tokenId, tokenOwnerAddress);
if (_.isUndefined(this._initialTokenIdsByOwner[tokenOwnerAddress])) {
if (this._initialTokenIdsByOwner[tokenOwnerAddress] === undefined) {
this._initialTokenIdsByOwner[tokenOwnerAddress] = {
[dummyTokenContract.address]: [],
};
}
if (_.isUndefined(this._initialTokenIdsByOwner[tokenOwnerAddress][dummyTokenContract.address])) {
if (this._initialTokenIdsByOwner[tokenOwnerAddress][dummyTokenContract.address] === undefined) {
this._initialTokenIdsByOwner[tokenOwnerAddress][dummyTokenContract.address] = [];
}
this._initialTokenIdsByOwner[tokenOwnerAddress][dummyTokenContract.address].push(tokenId);
@@ -92,20 +90,20 @@ export class ERC721Wrapper {
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
const tokenOwner = await this.ownerOfAsync(tokenAddress, tokenId);
const proxyAddress = (this._proxyContract as ERC721ProxyContract).address;
await this._web3Wrapper.awaitTransactionSuccessAsync(
await tokenContract.setApprovalForAll.sendTransactionAsync(proxyAddress, isApproved, {
from: tokenOwner,
}),
await tokenContract.setApprovalForAll.awaitTransactionSuccessAsync(
proxyAddress,
isApproved,
{ from: tokenOwner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
}
public async approveAsync(to: string, tokenAddress: string, tokenId: BigNumber): Promise<void> {
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
const tokenOwner = await this.ownerOfAsync(tokenAddress, tokenId);
await this._web3Wrapper.awaitTransactionSuccessAsync(
await tokenContract.approve.sendTransactionAsync(to, tokenId, {
from: tokenOwner,
}),
await tokenContract.approve.awaitTransactionSuccessAsync(
to,
tokenId,
{ from: tokenOwner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
}
@@ -116,28 +114,29 @@ export class ERC721Wrapper {
userAddress: string,
): Promise<void> {
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
await this._web3Wrapper.awaitTransactionSuccessAsync(
await tokenContract.transferFrom.sendTransactionAsync(currentOwner, userAddress, tokenId, {
from: currentOwner,
}),
await tokenContract.transferFrom.awaitTransactionSuccessAsync(
currentOwner,
userAddress,
tokenId,
{ from: currentOwner },
constants.AWAIT_TRANSACTION_MINED_MS,
);
}
public async mintAsync(tokenAddress: string, tokenId: BigNumber, userAddress: string): Promise<void> {
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
await this._web3Wrapper.awaitTransactionSuccessAsync(
await tokenContract.mint.sendTransactionAsync(userAddress, tokenId, {
from: this._contractOwnerAddress,
}),
await tokenContract.mint.awaitTransactionSuccessAsync(
userAddress,
tokenId,
{ from: this._contractOwnerAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
}
public async burnAsync(tokenAddress: string, tokenId: BigNumber, owner: string): Promise<void> {
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
await this._web3Wrapper.awaitTransactionSuccessAsync(
await tokenContract.burn.sendTransactionAsync(owner, tokenId, {
from: this._contractOwnerAddress,
}),
await tokenContract.burn.awaitTransactionSuccessAsync(
owner,
tokenId,
{ from: this._contractOwnerAddress },
constants.AWAIT_TRANSACTION_MINED_MS,
);
}
@@ -190,12 +189,12 @@ export class ERC721Wrapper {
_.forEach(tokenOwnerAddresses, (tokenOwnerAddress, ownerIndex) => {
const tokenAddress = tokenInfo[ownerIndex].tokenAddress;
const tokenId = tokenInfo[ownerIndex].tokenId;
if (_.isUndefined(tokenIdsByOwner[tokenOwnerAddress])) {
if (tokenIdsByOwner[tokenOwnerAddress] === undefined) {
tokenIdsByOwner[tokenOwnerAddress] = {
[tokenAddress]: [],
};
}
if (_.isUndefined(tokenIdsByOwner[tokenOwnerAddress][tokenAddress])) {
if (tokenIdsByOwner[tokenOwnerAddress][tokenAddress] === undefined) {
tokenIdsByOwner[tokenOwnerAddress][tokenAddress] = [];
}
tokenIdsByOwner[tokenOwnerAddress][tokenAddress].push(tokenId);
@@ -211,18 +210,18 @@ export class ERC721Wrapper {
}
private _getTokenContractFromAssetData(tokenAddress: string): DummyERC721TokenContract {
const tokenContractIfExists = _.find(this._dummyTokenContracts, c => c.address === tokenAddress);
if (_.isUndefined(tokenContractIfExists)) {
if (tokenContractIfExists === undefined) {
throw new Error(`Token: ${tokenAddress} was not deployed through ERC20Wrapper`);
}
return tokenContractIfExists;
}
private _validateDummyTokenContractsExistOrThrow(): void {
if (_.isUndefined(this._dummyTokenContracts)) {
if (this._dummyTokenContracts === undefined) {
throw new Error('Dummy ERC721 tokens not yet deployed, please call "deployDummyTokensAsync"');
}
}
private _validateProxyContractExistsOrThrow(): void {
if (_.isUndefined(this._proxyContract)) {
if (this._proxyContract === undefined) {
throw new Error('ERC721 proxy contract not yet deployed, please call "deployProxyAsync"');
}
}

View File

@@ -1,2 +1,3 @@
export * from './erc20_wrapper';
export * from './erc721_wrapper';
export * from './erc1155_proxy_wrapper';

View File

@@ -1,19 +1,18 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib",
"rootDir": ".",
"resolveJsonModule": true
},
"compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true },
"include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"],
"files": [
"./generated-artifacts/IAssetData.json",
"./generated-artifacts/IAssetProxy.json",
"./generated-artifacts/IAuthorizable.json",
"./generated-artifacts/ERC20Proxy.json",
"./generated-artifacts/ERC721Proxy.json",
"./generated-artifacts/MixinAuthorizable.json",
"./generated-artifacts/MultiAssetProxy.json"
"generated-artifacts/ERC1155Proxy.json",
"generated-artifacts/ERC20Proxy.json",
"generated-artifacts/ERC721Proxy.json",
"generated-artifacts/IAssetData.json",
"generated-artifacts/IAssetProxy.json",
"generated-artifacts/IAuthorizable.json",
"generated-artifacts/MixinAuthorizable.json",
"generated-artifacts/MultiAssetProxy.json",
"generated-artifacts/StaticCallProxy.json",
"generated-artifacts/TestStaticCallTarget.json"
],
"exclude": ["./deploy/solc/solc_bin"]
}

View File

@@ -0,0 +1,156 @@
[
{
"timestamp": 1567521715,
"version": "2.0.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1558712885,
"version": "2.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1557961111,
"version": "2.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1557799313,
"version": "2.0.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1557507213,
"version": "2.0.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "2.0.0",
"changes": [
{
"note": "Make `decodeOrdersFromFillData`, `getCoordinatorApprovalHash`, and `getTransactionHash` public",
"pr": 1729
},
{
"note": "Make `assertValidTransactionOrdersApproval` internal",
"pr": 1729
}
],
"timestamp": 1554997931
},
{
"version": "1.1.0",
"changes": [
{
"note": "Run Web3ProviderEngine without excess block polling",
"pr": 1695
}
],
"timestamp": 1553183790
},
{
"version": "1.0.0",
"changes": [
{
"note": "Created Coordinator package"
},
{
"note": "Use separate EIP712 domains for transactions and approvals",
"pr": 1705
},
{
"note": "Add `SignatureType.Invalid`",
"pr": 1705
},
{
"note": "Set `evmVersion` to `constantinople`",
"pr": 1707
}
],
"timestamp": 1553091633
}
]

View File

@@ -0,0 +1,70 @@
<!--
changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
## v2.0.12 - _September 3, 2019_
* Dependencies updated
## 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
## v2.0.4 - _May 24, 2019_
* Dependencies updated
## v2.0.3 - _May 15, 2019_
* Dependencies updated
## v2.0.2 - _May 14, 2019_
* Dependencies updated
## v2.0.1 - _May 10, 2019_
* Dependencies updated
## v2.0.0 - _April 11, 2019_
* Make `decodeOrdersFromFillData`, `getCoordinatorApprovalHash`, and `getTransactionHash` public (#1729)
* Make `assertValidTransactionOrdersApproval` internal (#1729)
## v1.1.0 - _March 21, 2019_
* Run Web3ProviderEngine without excess block polling (#1695)
## v1.0.0 - _March 20, 2019_
* Created Coordinator package
* Use separate EIP712 domains for transactions and approvals (#1705)
* Add `SignatureType.Invalid` (#1705)
* Set `evmVersion` to `constantinople` (#1707)

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,73 @@
## Coordinator
This package contains a contract that allows users to call arbitrary functions on the Exchange contract with permission from one or more Coordinators. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
## Installation
**Install**
```bash
npm install @0x/contracts-coordinator --save
```
## Bug bounty
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
## Contributing
We strongly recommend that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository.
For proposals regarding the 0x protocol's smart contract architecture, message format, or additional functionality, go to the [0x Improvement Proposals (ZEIPs)](https://github.com/0xProject/ZEIPs) repository and follow the contribution guidelines provided therein.
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
### Install Dependencies
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
```bash
yarn config set workspaces-experimental true
```
Then install dependencies
```bash
yarn install
```
### Build
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
PKG=@0x/contracts-coordinator yarn build
```
Or continuously rebuild on change:
```bash
PKG=@0x/contracts-coordinator yarn watch
```
### Clean
```bash
yarn clean
```
### Lint
```bash
yarn lint
```
### Run Tests
```bash
yarn test
```
#### Testing options
Contracts testing options like coverage, profiling, revert traces or backing node choosing - are described [here](../TESTING.md).

View File

@@ -0,0 +1,26 @@
{
"artifactsDir": "./generated-artifacts",
"contractsDir": "./contracts",
"useDockerisedSolc": false,
"compilerSettings": {
"evmVersion": "constantinople",
"optimizer": {
"enabled": true,
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": {
"*": {
"*": [
"abi",
"devdoc",
"evm.bytecode.object",
"evm.bytecode.sourceMap",
"evm.deployedBytecode.object",
"evm.deployedBytecode.sourceMap"
]
}
}
},
"contracts": ["src/Coordinator.sol", "src/registry/CoordinatorRegistry.sol"]
}

View File

@@ -0,0 +1,39 @@
/*
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;
pragma experimental "ABIEncoderV2";
import "./libs/LibConstants.sol";
import "./MixinSignatureValidator.sol";
import "./MixinCoordinatorApprovalVerifier.sol";
import "./MixinCoordinatorCore.sol";
// solhint-disable no-empty-blocks
contract Coordinator is
LibConstants,
MixinSignatureValidator,
MixinCoordinatorApprovalVerifier,
MixinCoordinatorCore
{
constructor (address _exchange)
public
LibConstants(_exchange)
{}
}

View File

@@ -0,0 +1,203 @@
/*
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;
pragma experimental "ABIEncoderV2";
import "@0x/contracts-exchange-libs/contracts/src/LibExchangeSelectors.sol";
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
import "@0x/contracts-utils/contracts/src/LibAddressArray.sol";
import "./libs/LibCoordinatorApproval.sol";
import "./libs/LibZeroExTransaction.sol";
import "./mixins/MSignatureValidator.sol";
import "./mixins/MCoordinatorApprovalVerifier.sol";
// solhint-disable avoid-tx-origin
contract MixinCoordinatorApprovalVerifier is
LibExchangeSelectors,
LibCoordinatorApproval,
LibZeroExTransaction,
MSignatureValidator,
MCoordinatorApprovalVerifier
{
using LibBytes for bytes;
using LibAddressArray for address[];
/// @dev Validates that the 0x transaction has been approved by all of the feeRecipients
/// that correspond to each order in the transaction's Exchange calldata.
/// @param transaction 0x transaction containing salt, signerAddress, and data.
/// @param txOrigin Required signer of Ethereum transaction calling this function.
/// @param transactionSignature Proof that the transaction has been signed by the signer.
/// @param approvalExpirationTimeSeconds Array of expiration times in seconds for which each corresponding approval signature expires.
/// @param approvalSignatures Array of signatures that correspond to the feeRecipients of each order in the transaction's Exchange calldata.
function assertValidCoordinatorApprovals(
LibZeroExTransaction.ZeroExTransaction memory transaction,
address txOrigin,
bytes memory transactionSignature,
uint256[] memory approvalExpirationTimeSeconds,
bytes[] memory approvalSignatures
)
public
view
{
// Get the orders from the the Exchange calldata in the 0x transaction
LibOrder.Order[] memory orders = decodeOrdersFromFillData(transaction.data);
// No approval is required for non-fill methods
if (orders.length > 0) {
// Revert if approval is invalid for transaction orders
assertValidTransactionOrdersApproval(
transaction,
orders,
txOrigin,
transactionSignature,
approvalExpirationTimeSeconds,
approvalSignatures
);
}
}
/// @dev Decodes the orders from Exchange calldata representing any fill method.
/// @param data Exchange calldata representing a fill method.
/// @return The orders from the Exchange calldata.
function decodeOrdersFromFillData(bytes memory data)
public
pure
returns (LibOrder.Order[] memory orders)
{
bytes4 selector = data.readBytes4(0);
if (
selector == FILL_ORDER_SELECTOR ||
selector == FILL_ORDER_NO_THROW_SELECTOR ||
selector == FILL_OR_KILL_ORDER_SELECTOR
) {
// Decode single order
(LibOrder.Order memory order) = abi.decode(
data.slice(4, data.length),
(LibOrder.Order)
);
orders = new LibOrder.Order[](1);
orders[0] = order;
} else if (
selector == BATCH_FILL_ORDERS_SELECTOR ||
selector == BATCH_FILL_ORDERS_NO_THROW_SELECTOR ||
selector == BATCH_FILL_OR_KILL_ORDERS_SELECTOR ||
selector == MARKET_BUY_ORDERS_SELECTOR ||
selector == MARKET_BUY_ORDERS_NO_THROW_SELECTOR ||
selector == MARKET_SELL_ORDERS_SELECTOR ||
selector == MARKET_SELL_ORDERS_NO_THROW_SELECTOR
) {
// Decode all orders
// solhint-disable indent
(orders) = abi.decode(
data.slice(4, data.length),
(LibOrder.Order[])
);
} else if (selector == MATCH_ORDERS_SELECTOR) {
// Decode left and right orders
(LibOrder.Order memory leftOrder, LibOrder.Order memory rightOrder) = abi.decode(
data.slice(4, data.length),
(LibOrder.Order, LibOrder.Order)
);
// Create array of orders
orders = new LibOrder.Order[](2);
orders[0] = leftOrder;
orders[1] = rightOrder;
}
return orders;
}
/// @dev Validates that the feeRecipients of a batch of order have approved a 0x transaction.
/// @param transaction 0x transaction containing salt, signerAddress, and data.
/// @param orders Array of order structs containing order specifications.
/// @param txOrigin Required signer of Ethereum transaction calling this function.
/// @param transactionSignature Proof that the transaction has been signed by the signer.
/// @param approvalExpirationTimeSeconds Array of expiration times in seconds for which each corresponding approval signature expires.
/// @param approvalSignatures Array of signatures that correspond to the feeRecipients of each order.
function assertValidTransactionOrdersApproval(
LibZeroExTransaction.ZeroExTransaction memory transaction,
LibOrder.Order[] memory orders,
address txOrigin,
bytes memory transactionSignature,
uint256[] memory approvalExpirationTimeSeconds,
bytes[] memory approvalSignatures
)
internal
view
{
// Verify that Ethereum tx signer is the same as the approved txOrigin
require(
tx.origin == txOrigin,
"INVALID_ORIGIN"
);
// Hash 0x transaction
bytes32 transactionHash = getTransactionHash(transaction);
// Create empty list of approval signers
address[] memory approvalSignerAddresses = new address[](0);
uint256 signaturesLength = approvalSignatures.length;
for (uint256 i = 0; i != signaturesLength; i++) {
// Create approval message
uint256 currentApprovalExpirationTimeSeconds = approvalExpirationTimeSeconds[i];
CoordinatorApproval memory approval = CoordinatorApproval({
txOrigin: txOrigin,
transactionHash: transactionHash,
transactionSignature: transactionSignature,
approvalExpirationTimeSeconds: currentApprovalExpirationTimeSeconds
});
// Ensure approval has not expired
require(
// solhint-disable-next-line not-rely-on-time
currentApprovalExpirationTimeSeconds > block.timestamp,
"APPROVAL_EXPIRED"
);
// Hash approval message and recover signer address
bytes32 approvalHash = getCoordinatorApprovalHash(approval);
address approvalSignerAddress = getSignerAddress(approvalHash, approvalSignatures[i]);
// Add approval signer to list of signers
approvalSignerAddresses = approvalSignerAddresses.append(approvalSignerAddress);
}
// Ethereum transaction signer gives implicit signature of approval
approvalSignerAddresses = approvalSignerAddresses.append(tx.origin);
uint256 ordersLength = orders.length;
for (uint256 i = 0; i != ordersLength; i++) {
// Do not check approval if the order's senderAddress is null
if (orders[i].senderAddress == address(0)) {
continue;
}
// Ensure feeRecipient of order has approved this 0x transaction
address approverAddress = orders[i].feeRecipientAddress;
bool isOrderApproved = approvalSignerAddresses.contains(approverAddress);
require(
isOrderApproved,
"INVALID_APPROVAL_SIGNATURE"
);
}
}
}

View File

@@ -0,0 +1,65 @@
/*
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;
pragma experimental "ABIEncoderV2";
import "./libs/LibZeroExTransaction.sol";
import "./libs/LibConstants.sol";
import "./mixins/MCoordinatorApprovalVerifier.sol";
import "./interfaces/ICoordinatorCore.sol";
contract MixinCoordinatorCore is
LibConstants,
MCoordinatorApprovalVerifier,
ICoordinatorCore
{
/// @dev Executes a 0x transaction that has been signed by the feeRecipients that correspond to each order in the transaction's Exchange calldata.
/// @param transaction 0x transaction containing salt, signerAddress, and data.
/// @param txOrigin Required signer of Ethereum transaction calling this function.
/// @param transactionSignature Proof that the transaction has been signed by the signer.
/// @param approvalExpirationTimeSeconds Array of expiration times in seconds for which each corresponding approval signature expires.
/// @param approvalSignatures Array of signatures that correspond to the feeRecipients of each order in the transaction's Exchange calldata.
function executeTransaction(
LibZeroExTransaction.ZeroExTransaction memory transaction,
address txOrigin,
bytes memory transactionSignature,
uint256[] memory approvalExpirationTimeSeconds,
bytes[] memory approvalSignatures
)
public
{
// Validate that the 0x transaction has been approves by each feeRecipient
assertValidCoordinatorApprovals(
transaction,
txOrigin,
transactionSignature,
approvalExpirationTimeSeconds,
approvalSignatures
);
// Execute the transaction
EXCHANGE.executeTransaction(
transaction.salt,
transaction.signerAddress,
transaction.data,
transactionSignature
);
}
}

View File

@@ -0,0 +1,118 @@
/*
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 "@0x/contracts-utils/contracts/src/LibBytes.sol";
import "./mixins/MSignatureValidator.sol";
contract MixinSignatureValidator is
MSignatureValidator
{
using LibBytes for bytes;
/// @dev Recovers the address of a signer given a hash and signature.
/// @param hash Any 32 byte hash.
/// @param signature Proof that the hash has been signed by signer.
function getSignerAddress(bytes32 hash, bytes memory signature)
public
pure
returns (address signerAddress)
{
require(
signature.length > 0,
"LENGTH_GREATER_THAN_0_REQUIRED"
);
// Pop last byte off of signature byte array.
uint8 signatureTypeRaw = uint8(signature.popLastByte());
// Ensure signature is supported
require(
signatureTypeRaw < uint8(SignatureType.NSignatureTypes),
"SIGNATURE_UNSUPPORTED"
);
SignatureType signatureType = SignatureType(signatureTypeRaw);
// Always illegal signature.
// This is always an implicit option since a signer can create a
// signature array with invalid type or length. We may as well make
// it an explicit option. This aids testing and analysis. It is
// also the initialization value for the enum type.
if (signatureType == SignatureType.Illegal) {
revert("SIGNATURE_ILLEGAL");
// Always invalid signature.
// Like Illegal, this is always implicitly available and therefore
// offered explicitly. It can be implicitly created by providing
// a correctly formatted but incorrect signature.
} else if (signatureType == SignatureType.Invalid) {
require(
signature.length == 0,
"LENGTH_0_REQUIRED"
);
revert("SIGNATURE_INVALID");
// Signature using EIP712
} else if (signatureType == SignatureType.EIP712) {
require(
signature.length == 65,
"LENGTH_65_REQUIRED"
);
uint8 v = uint8(signature[0]);
bytes32 r = signature.readBytes32(1);
bytes32 s = signature.readBytes32(33);
signerAddress = ecrecover(
hash,
v,
r,
s
);
return signerAddress;
// Signed using web3.eth_sign
} else if (signatureType == SignatureType.EthSign) {
require(
signature.length == 65,
"LENGTH_65_REQUIRED"
);
uint8 v = uint8(signature[0]);
bytes32 r = signature.readBytes32(1);
bytes32 s = signature.readBytes32(33);
signerAddress = ecrecover(
keccak256(abi.encodePacked(
"\x19Ethereum Signed Message:\n32",
hash
)),
v,
r,
s
);
return signerAddress;
}
// Anything else is illegal (We do not return false because
// the signature may actually be valid, just not in a format
// that we currently support. In this case returning false
// may lead the caller to incorrectly believe that the
// signature was invalid.)
revert("SIGNATURE_UNSUPPORTED");
}
}

View File

@@ -0,0 +1,52 @@
/*
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;
pragma experimental "ABIEncoderV2";
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
import "../libs/LibZeroExTransaction.sol";
contract ICoordinatorApprovalVerifier {
/// @dev Validates that the 0x transaction has been approved by all of the feeRecipients
/// that correspond to each order in the transaction's Exchange calldata.
/// @param transaction 0x transaction containing salt, signerAddress, and data.
/// @param txOrigin Required signer of Ethereum transaction calling this function.
/// @param transactionSignature Proof that the transaction has been signed by the signer.
/// @param approvalExpirationTimeSeconds Array of expiration times in seconds for which each corresponding approval signature expires.
/// @param approvalSignatures Array of signatures that correspond to the feeRecipients of each order in the transaction's Exchange calldata.
function assertValidCoordinatorApprovals(
LibZeroExTransaction.ZeroExTransaction memory transaction,
address txOrigin,
bytes memory transactionSignature,
uint256[] memory approvalExpirationTimeSeconds,
bytes[] memory approvalSignatures
)
public
view;
/// @dev Decodes the orders from Exchange calldata representing any fill method.
/// @param data Exchange calldata representing a fill method.
/// @return The orders from the Exchange calldata.
function decodeOrdersFromFillData(bytes memory data)
public
pure
returns (LibOrder.Order[] memory orders);
}

View File

@@ -0,0 +1,41 @@
/*
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;
pragma experimental "ABIEncoderV2";
import "../libs/LibZeroExTransaction.sol";
contract ICoordinatorCore {
/// @dev Executes a 0x transaction that has been signed by the feeRecipients that correspond to each order in the transaction's Exchange calldata.
/// @param transaction 0x transaction containing salt, signerAddress, and data.
/// @param txOrigin Required signer of Ethereum transaction calling this function.
/// @param transactionSignature Proof that the transaction has been signed by the signer.
/// @param approvalExpirationTimeSeconds Array of expiration times in seconds for which each corresponding approval signature expires.
/// @param approvalSignatures Array of signatures that correspond to the feeRecipients of each order in the transaction's Exchange calldata.
function executeTransaction(
LibZeroExTransaction.ZeroExTransaction memory transaction,
address txOrigin,
bytes memory transactionSignature,
uint256[] memory approvalExpirationTimeSeconds,
bytes[] memory approvalSignatures
)
public;
}

View File

@@ -0,0 +1,31 @@
/*
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 ISignatureValidator {
/// @dev Recovers the address of a signer given a hash and signature.
/// @param hash Any 32 byte hash.
/// @param signature Proof that the hash has been signed by signer.
function getSignerAddress(bytes32 hash, bytes memory signature)
public
pure
returns (address signerAddress);
}

View File

@@ -0,0 +1,35 @@
/*
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 ITransactions {
/// @dev Executes an exchange method call in the context of signer.
/// @param salt Arbitrary number to ensure uniqueness of transaction hash.
/// @param signerAddress Address of transaction signer.
/// @param data AbiV2 encoded calldata.
/// @param signature Proof of signer transaction by signer.
function executeTransaction(
uint256 salt,
address signerAddress,
bytes calldata data,
bytes calldata signature
)
external;
}

View File

@@ -0,0 +1,34 @@
/*
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 "../interfaces/ITransactions.sol";
contract LibConstants {
// solhint-disable-next-line var-name-mixedcase
ITransactions internal EXCHANGE;
constructor (address _exchange)
public
{
EXCHANGE = ITransactions(_exchange);
}
}

View File

@@ -0,0 +1,98 @@
/*
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;
pragma experimental "ABIEncoderV2";
import "./LibEIP712Domain.sol";
contract LibCoordinatorApproval is
LibEIP712Domain
{
// Hash for the EIP712 Coordinator approval message
// keccak256(abi.encodePacked(
// "CoordinatorApproval(",
// "address txOrigin,",
// "bytes32 transactionHash,",
// "bytes transactionSignature,",
// "uint256 approvalExpirationTimeSeconds",
// ")"
// ));
bytes32 constant internal EIP712_COORDINATOR_APPROVAL_SCHEMA_HASH = 0x2fbcdbaa76bc7589916958ae919dfbef04d23f6bbf26de6ff317b32c6cc01e05;
struct CoordinatorApproval {
address txOrigin; // Required signer of Ethereum transaction that is submitting approval.
bytes32 transactionHash; // EIP712 hash of the transaction.
bytes transactionSignature; // Signature of the 0x transaction.
uint256 approvalExpirationTimeSeconds; // Timestamp in seconds for which the approval expires.
}
/// @dev Calculated the EIP712 hash of the Coordinator approval mesasage using the domain separator of this contract.
/// @param approval Coordinator approval message containing the transaction hash, transaction signature, and expiration of the approval.
/// @return EIP712 hash of the Coordinator approval message with the domain separator of this contract.
function getCoordinatorApprovalHash(CoordinatorApproval memory approval)
public
view
returns (bytes32 approvalHash)
{
approvalHash = hashEIP712CoordinatorMessage(hashCoordinatorApproval(approval));
return approvalHash;
}
/// @dev Calculated the EIP712 hash of the Coordinator approval mesasage with no domain separator.
/// @param approval Coordinator approval message containing the transaction hash, transaction signature, and expiration of the approval.
/// @return EIP712 hash of the Coordinator approval message with no domain separator.
function hashCoordinatorApproval(CoordinatorApproval memory approval)
internal
pure
returns (bytes32 result)
{
bytes32 schemaHash = EIP712_COORDINATOR_APPROVAL_SCHEMA_HASH;
bytes memory transactionSignature = approval.transactionSignature;
address txOrigin = approval.txOrigin;
bytes32 transactionHash = approval.transactionHash;
uint256 approvalExpirationTimeSeconds = approval.approvalExpirationTimeSeconds;
// Assembly for more efficiently computing:
// keccak256(abi.encodePacked(
// EIP712_COORDINATOR_APPROVAL_SCHEMA_HASH,
// approval.txOrigin,
// approval.transactionHash,
// keccak256(approval.transactionSignature)
// approval.approvalExpirationTimeSeconds,
// ));
assembly {
// Compute hash of transaction signature
let transactionSignatureHash := keccak256(add(transactionSignature, 32), mload(transactionSignature))
// Load free memory pointer
let memPtr := mload(64)
mstore(memPtr, schemaHash) // hash of schema
mstore(add(memPtr, 32), txOrigin) // txOrigin
mstore(add(memPtr, 64), transactionHash) // transactionHash
mstore(add(memPtr, 96), transactionSignatureHash) // transactionSignatureHash
mstore(add(memPtr, 128), approvalExpirationTimeSeconds) // approvalExpirationTimeSeconds
// Compute hash
result := keccak256(memPtr, 160)
}
return result;
}
}

View File

@@ -0,0 +1,131 @@
/*
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 "./LibConstants.sol";
contract LibEIP712Domain is
LibConstants
{
// EIP191 header for EIP712 prefix
string constant internal EIP191_HEADER = "\x19\x01";
// EIP712 Domain Name value for the Coordinator
string constant internal EIP712_COORDINATOR_DOMAIN_NAME = "0x Protocol Coordinator";
// EIP712 Domain Version value for the Coordinator
string constant internal EIP712_COORDINATOR_DOMAIN_VERSION = "1.0.0";
// EIP712 Domain Name value for the Exchange
string constant internal EIP712_EXCHANGE_DOMAIN_NAME = "0x Protocol";
// EIP712 Domain Version value for the Exchange
string constant internal EIP712_EXCHANGE_DOMAIN_VERSION = "2";
// Hash of the EIP712 Domain Separator Schema
bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(abi.encodePacked(
"EIP712Domain(",
"string name,",
"string version,",
"address verifyingContract",
")"
));
// Hash of the EIP712 Domain Separator data for the Coordinator
// solhint-disable-next-line var-name-mixedcase
bytes32 public EIP712_COORDINATOR_DOMAIN_HASH;
// Hash of the EIP712 Domain Separator data for the Exchange
// solhint-disable-next-line var-name-mixedcase
bytes32 public EIP712_EXCHANGE_DOMAIN_HASH;
constructor ()
public
{
EIP712_COORDINATOR_DOMAIN_HASH = keccak256(abi.encodePacked(
EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,
keccak256(bytes(EIP712_COORDINATOR_DOMAIN_NAME)),
keccak256(bytes(EIP712_COORDINATOR_DOMAIN_VERSION)),
uint256(address(this))
));
EIP712_EXCHANGE_DOMAIN_HASH = keccak256(abi.encodePacked(
EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,
keccak256(bytes(EIP712_EXCHANGE_DOMAIN_NAME)),
keccak256(bytes(EIP712_EXCHANGE_DOMAIN_VERSION)),
uint256(address(EXCHANGE))
));
}
/// @dev Calculates EIP712 encoding for a hash struct in the EIP712 domain
/// of this contract.
/// @param hashStruct The EIP712 hash struct.
/// @return EIP712 hash applied to this EIP712 Domain.
function hashEIP712CoordinatorMessage(bytes32 hashStruct)
internal
view
returns (bytes32 result)
{
return hashEIP712Message(EIP712_COORDINATOR_DOMAIN_HASH, hashStruct);
}
/// @dev Calculates EIP712 encoding for a hash struct in the EIP712 domain
/// of the Exchange contract.
/// @param hashStruct The EIP712 hash struct.
/// @return EIP712 hash applied to the Exchange EIP712 Domain.
function hashEIP712ExchangeMessage(bytes32 hashStruct)
internal
view
returns (bytes32 result)
{
return hashEIP712Message(EIP712_EXCHANGE_DOMAIN_HASH, hashStruct);
}
/// @dev Calculates EIP712 encoding for a hash struct with a given domain hash.
/// @param eip712DomainHash Hash of the domain domain separator data.
/// @param hashStruct The EIP712 hash struct.
/// @return EIP712 hash applied to the Exchange EIP712 Domain.
function hashEIP712Message(bytes32 eip712DomainHash, bytes32 hashStruct)
internal
pure
returns (bytes32 result)
{
// Assembly for more efficient computing:
// keccak256(abi.encodePacked(
// EIP191_HEADER,
// EIP712_DOMAIN_HASH,
// hashStruct
// ));
assembly {
// Load free memory pointer
let memPtr := mload(64)
mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header
mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash
mstore(add(memPtr, 34), hashStruct) // Hash of struct
// Compute hash
result := keccak256(memPtr, 66)
}
return result;
}
}

View File

@@ -0,0 +1,95 @@
/*
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;
pragma experimental "ABIEncoderV2";
import "./LibEIP712Domain.sol";
contract LibZeroExTransaction is
LibEIP712Domain
{
// Hash for the EIP712 0x transaction schema
// keccak256(abi.encodePacked(
// "ZeroExTransaction(",
// "uint256 salt,",
// "address signerAddress,",
// "bytes data",
// ")"
// ));
bytes32 constant internal EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH = 0x213c6f636f3ea94e701c0adf9b2624aa45a6c694f9a292c094f9a81c24b5df4c;
struct ZeroExTransaction {
uint256 salt; // Arbitrary number to ensure uniqueness of transaction hash.
address signerAddress; // Address of transaction signer.
bytes data; // AbiV2 encoded calldata.
}
/// @dev Calculates the EIP712 hash of a 0x transaction using the domain separator of the Exchange contract.
/// @param transaction 0x transaction containing salt, signerAddress, and data.
/// @return EIP712 hash of the transaction with the domain separator of this contract.
function getTransactionHash(ZeroExTransaction memory transaction)
public
view
returns (bytes32 transactionHash)
{
// Hash the transaction with the domain separator of the Exchange contract.
transactionHash = hashEIP712ExchangeMessage(hashZeroExTransaction(transaction));
return transactionHash;
}
/// @dev Calculates EIP712 hash of the 0x transaction with no domain separator.
/// @param transaction 0x transaction containing salt, signerAddress, and data.
/// @return EIP712 hash of the transaction with no domain separator.
function hashZeroExTransaction(ZeroExTransaction memory transaction)
internal
pure
returns (bytes32 result)
{
bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;
bytes memory data = transaction.data;
uint256 salt = transaction.salt;
address signerAddress = transaction.signerAddress;
// Assembly for more efficiently computing:
// keccak256(abi.encodePacked(
// EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,
// transaction.salt,
// uint256(transaction.signerAddress),
// keccak256(transaction.data)
// ));
assembly {
// Compute hash of data
let dataHash := keccak256(add(data, 32), mload(data))
// Load free memory pointer
let memPtr := mload(64)
mstore(memPtr, schemaHash) // hash of schema
mstore(add(memPtr, 32), salt) // salt
mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress
mstore(add(memPtr, 96), dataHash) // hash of data
// Compute hash
result := keccak256(memPtr, 128)
}
return result;
}
}

View File

@@ -0,0 +1,46 @@
/*
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;
pragma experimental "ABIEncoderV2";
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
import "../interfaces/ICoordinatorApprovalVerifier.sol";
contract MCoordinatorApprovalVerifier is
ICoordinatorApprovalVerifier
{
/// @dev Validates that the feeRecipients of a batch of order have approved a 0x transaction.
/// @param transaction 0x transaction containing salt, signerAddress, and data.
/// @param orders Array of order structs containing order specifications.
/// @param txOrigin Required signer of Ethereum transaction calling this function.
/// @param transactionSignature Proof that the transaction has been signed by the signer.
/// @param approvalExpirationTimeSeconds Array of expiration times in seconds for which each corresponding approval signature expires.
/// @param approvalSignatures Array of signatures that correspond to the feeRecipients of each order.
function assertValidTransactionOrdersApproval(
LibZeroExTransaction.ZeroExTransaction memory transaction,
LibOrder.Order[] memory orders,
address txOrigin,
bytes memory transactionSignature,
uint256[] memory approvalExpirationTimeSeconds,
bytes[] memory approvalSignatures
)
internal
view;
}

View File

@@ -0,0 +1,35 @@
/*
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 "../interfaces/ISignatureValidator.sol";
contract MSignatureValidator is
ISignatureValidator
{
// Allowed signature types.
enum SignatureType {
Illegal, // 0x00, default value
Invalid, // 0x01
EIP712, // 0x02
EthSign, // 0x03
NSignatureTypes // 0x04, number of signature types. Always leave at end.
}
}

View File

@@ -0,0 +1,32 @@
/*
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 "./MixinCoordinatorRegistryCore.sol";
// solhint-disable no-empty-blocks
contract CoordinatorRegistry is
MixinCoordinatorRegistryCore
{
constructor ()
public
MixinCoordinatorRegistryCore()
{}
}

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;
import "./interfaces/ICoordinatorRegistryCore.sol";
// solhint-disable no-empty-blocks
contract MixinCoordinatorRegistryCore is
ICoordinatorRegistryCore
{
// mapping from `coordinatorOperator` -> `coordinatorEndpoint`
mapping (address => string) internal coordinatorEndpoints;
/// @dev Called by a Coordinator operator to set the endpoint of their Coordinator.
/// @param coordinatorEndpoint endpoint of the Coordinator.
function setCoordinatorEndpoint(string calldata coordinatorEndpoint) external {
address coordinatorOperator = msg.sender;
coordinatorEndpoints[coordinatorOperator] = coordinatorEndpoint;
emit CoordinatorEndpointSet(coordinatorOperator, coordinatorEndpoint);
}
/// @dev Gets the endpoint for a Coordinator.
/// @param coordinatorOperator operator of the Coordinator endpoint.
function getCoordinatorEndpoint(address coordinatorOperator)
external
view
returns (string memory coordinatorEndpoint)
{
return coordinatorEndpoints[coordinatorOperator];
}
}

View File

@@ -0,0 +1,41 @@
/*
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;
// solhint-disable no-empty-blocks
contract ICoordinatorRegistryCore
{
/// @dev Emitted when a Coordinator endpoint is set.
event CoordinatorEndpointSet(
address coordinatorOperator,
string coordinatorEndpoint
);
/// @dev Called by a Coordinator operator to set the endpoint of their Coordinator.
/// @param coordinatorEndpoint endpoint of the Coordinator.
function setCoordinatorEndpoint(string calldata coordinatorEndpoint) external;
/// @dev Gets the endpoint for a Coordinator.
/// @param coordinatorOperator operator of the Coordinator endpoint.
function getCoordinatorEndpoint(address coordinatorOperator)
external
view
returns (string memory coordinatorEndpoint);
}

View File

@@ -0,0 +1,90 @@
{
"name": "@0x/contracts-coordinator",
"version": "2.0.12",
"engines": {
"node": ">=6.12"
},
"description": "Smart contract extensions of 0x protocol",
"main": "lib/src/index.js",
"directories": {
"test": "test"
},
"scripts": {
"build": "yarn pre_build && tsc -b",
"build:ci": "yarn build",
"pre_build": "run-s compile generate_contract_wrappers",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s build test",
"test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov",
"test:profiler": "SOLIDITY_PROFILER=true run-s build run_mocha profiler:report:html",
"test:trace": "SOLIDITY_REVERT_TRACE=true run-s build run_mocha",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe 'lib/test/**/*.js' --timeout 100000 --bail --exit",
"compile": "sol-compiler",
"watch": "sol-compiler -w",
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
"coverage:report:text": "istanbul report text",
"coverage:report:html": "istanbul report html && open coverage/index.html",
"profiler:report:html": "istanbul report html && open coverage/index.html",
"coverage:report:lcov": "istanbul report lcov",
"test:circleci": "yarn test",
"contracts:gen": "contracts-gen",
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
},
"config": {
"abis": "./generated-artifacts/@(Coordinator|CoordinatorRegistry).json",
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
},
"repository": {
"type": "git",
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/0xProject/0x-monorepo/issues"
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
"devDependencies": {
"@0x/abi-gen": "^4.2.0",
"@0x/contracts-gen": "^1.0.14",
"@0x/contracts-test-utils": "^3.1.15",
"@0x/dev-utils": "^2.3.2",
"@0x/sol-compiler": "^3.1.14",
"@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": "^6.2.0",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"solhint": "^1.4.1",
"tslint": "5.11.0",
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.3",
"@0x/contracts-asset-proxy": "^2.2.7",
"@0x/contracts-erc20": "^2.2.13",
"@0x/contracts-exchange": "^2.1.13",
"@0x/contracts-exchange-libs": "^3.0.7",
"@0x/contracts-utils": "^3.2.3",
"@0x/order-utils": "^8.3.1",
"@0x/types": "^2.4.2",
"@0x/typescript-typings": "^4.2.5",
"@0x/utils": "^4.5.1",
"@0x/web3-wrapper": "^6.0.12",
"ethereum-types": "^2.1.5",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.11"
},
"publishConfig": {
"access": "public"
}
}

View File

@@ -0,0 +1,13 @@
/*
* -----------------------------------------------------------------------------
* Warning: This file is auto-generated by contracts-gen. Don't edit manually.
* -----------------------------------------------------------------------------
*/
import { ContractArtifact } from 'ethereum-types';
import * as Coordinator from '../generated-artifacts/Coordinator.json';
import * as CoordinatorRegistry from '../generated-artifacts/CoordinatorRegistry.json';
export const artifacts = {
Coordinator: Coordinator as ContractArtifact,
CoordinatorRegistry: CoordinatorRegistry as ContractArtifact,
};

View File

@@ -0,0 +1,3 @@
export * from './artifacts';
export * from './wrappers';
export * from '../test/utils';

View File

@@ -0,0 +1,7 @@
/*
* -----------------------------------------------------------------------------
* Warning: This file is auto-generated by contracts-gen. Don't edit manually.
* -----------------------------------------------------------------------------
*/
export * from '../generated-wrappers/coordinator';
export * from '../generated-wrappers/coordinator_registry';

View File

@@ -0,0 +1,523 @@
import { ERC20ProxyContract, ERC20Wrapper } from '@0x/contracts-asset-proxy';
import { DummyERC20TokenContract } from '@0x/contracts-erc20';
import {
artifacts as exchangeArtifacts,
ExchangeCancelEventArgs,
ExchangeCancelUpToEventArgs,
ExchangeContract,
ExchangeFillEventArgs,
} from '@0x/contracts-exchange';
import {
chaiSetup,
constants as devConstants,
expectTransactionFailedAsync,
getLatestBlockTimestampAsync,
OrderFactory,
provider,
TransactionFactory,
txDefaults,
web3Wrapper,
} from '@0x/contracts-test-utils';
import { BlockchainLifecycle } from '@0x/dev-utils';
import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
import { RevertReason, SignedOrder } from '@0x/types';
import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import { ApprovalFactory, artifacts, constants, CoordinatorContract, exchangeDataEncoder } from '../src';
chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
web3Wrapper.abiDecoder.addABI(exchangeArtifacts.Exchange.compilerOutput.abi);
// tslint:disable:no-unnecessary-type-assertion
describe('Coordinator tests', () => {
let makerAddress: string;
let owner: string;
let takerAddress: string;
let feeRecipientAddress: string;
let erc20Proxy: ERC20ProxyContract;
let erc20TokenA: DummyERC20TokenContract;
let erc20TokenB: DummyERC20TokenContract;
let zrxToken: DummyERC20TokenContract;
let coordinatorContract: CoordinatorContract;
let exchange: ExchangeContract;
let erc20Wrapper: ERC20Wrapper;
let orderFactory: OrderFactory;
let takerTransactionFactory: TransactionFactory;
let makerTransactionFactory: TransactionFactory;
let approvalFactory: ApprovalFactory;
before(async () => {
await blockchainLifecycle.startAsync();
});
after(async () => {
await blockchainLifecycle.revertAsync();
});
before(async () => {
const accounts = await web3Wrapper.getAvailableAddressesAsync();
const usedAddresses = ([owner, makerAddress, takerAddress, feeRecipientAddress] = accounts.slice(0, 4));
erc20Wrapper = new ERC20Wrapper(provider, usedAddresses, owner);
erc20Proxy = await erc20Wrapper.deployProxyAsync();
const numDummyErc20ToDeploy = 3;
[erc20TokenA, erc20TokenB, zrxToken] = await erc20Wrapper.deployDummyTokensAsync(
numDummyErc20ToDeploy,
devConstants.DUMMY_TOKEN_DECIMALS,
);
await erc20Wrapper.setBalancesAndAllowancesAsync();
exchange = await ExchangeContract.deployFrom0xArtifactAsync(
exchangeArtifacts.Exchange,
provider,
txDefaults,
artifacts,
assetDataUtils.encodeERC20AssetData(zrxToken.address),
);
await web3Wrapper.awaitTransactionSuccessAsync(
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: owner }),
devConstants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await exchange.registerAssetProxy.sendTransactionAsync(erc20Proxy.address, { from: owner }),
devConstants.AWAIT_TRANSACTION_MINED_MS,
);
coordinatorContract = await CoordinatorContract.deployFrom0xArtifactAsync(
artifacts.Coordinator,
provider,
txDefaults,
artifacts,
exchange.address,
);
// Configure order defaults
const defaultOrderParams = {
...devConstants.STATIC_ORDER_PARAMS,
exchangeAddress: exchange.address,
senderAddress: coordinatorContract.address,
makerAddress,
feeRecipientAddress,
makerAssetData: assetDataUtils.encodeERC20AssetData(erc20TokenA.address),
takerAssetData: assetDataUtils.encodeERC20AssetData(erc20TokenB.address),
};
const makerPrivateKey = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)];
const takerPrivateKey = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(takerAddress)];
const feeRecipientPrivateKey = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(feeRecipientAddress)];
orderFactory = new OrderFactory(makerPrivateKey, defaultOrderParams);
makerTransactionFactory = new TransactionFactory(makerPrivateKey, exchange.address);
takerTransactionFactory = new TransactionFactory(takerPrivateKey, exchange.address);
approvalFactory = new ApprovalFactory(feeRecipientPrivateKey, coordinatorContract.address);
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();
});
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
describe('single order fills', () => {
for (const fnName of constants.SINGLE_FILL_FN_NAMES) {
it(`${fnName} should fill the order with a signed approval`, async () => {
const orders = [await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = takerTransactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory.newSignedApproval(
transaction,
takerAddress,
approvalExpirationTimeSeconds,
);
const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync(
await coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
takerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: takerAddress },
),
devConstants.AWAIT_TRANSACTION_MINED_MS,
);
const fillLogs = transactionReceipt.logs.filter(
log => (log as LogWithDecodedArgs<ExchangeFillEventArgs>).event === 'Fill',
);
expect(fillLogs.length).to.eq(1);
const fillLogArgs = (fillLogs[0] as LogWithDecodedArgs<ExchangeFillEventArgs>).args;
expect(fillLogArgs.makerAddress).to.eq(makerAddress);
expect(fillLogArgs.takerAddress).to.eq(takerAddress);
expect(fillLogArgs.senderAddress).to.eq(coordinatorContract.address);
expect(fillLogArgs.feeRecipientAddress).to.eq(feeRecipientAddress);
expect(fillLogArgs.makerAssetData).to.eq(orders[0].makerAssetData);
expect(fillLogArgs.takerAssetData).to.eq(orders[0].takerAssetData);
expect(fillLogArgs.makerAssetFilledAmount).to.bignumber.eq(orders[0].makerAssetAmount);
expect(fillLogArgs.takerAssetFilledAmount).to.bignumber.eq(orders[0].takerAssetAmount);
expect(fillLogArgs.makerFeePaid).to.bignumber.eq(orders[0].makerFee);
expect(fillLogArgs.takerFeePaid).to.bignumber.eq(orders[0].takerFee);
expect(fillLogArgs.orderHash).to.eq(orderHashUtils.getOrderHashHex(orders[0]));
});
it(`${fnName} should fill the order if called by approver`, async () => {
const orders = [await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = takerTransactionFactory.newSignedTransaction(data);
const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync(
await coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
feeRecipientAddress,
transaction.signature,
[],
[],
{ from: feeRecipientAddress },
),
devConstants.AWAIT_TRANSACTION_MINED_MS,
);
const fillLogs = transactionReceipt.logs.filter(
log => (log as LogWithDecodedArgs<ExchangeFillEventArgs>).event === 'Fill',
);
expect(fillLogs.length).to.eq(1);
const fillLogArgs = (fillLogs[0] as LogWithDecodedArgs<ExchangeFillEventArgs>).args;
expect(fillLogArgs.makerAddress).to.eq(makerAddress);
expect(fillLogArgs.takerAddress).to.eq(takerAddress);
expect(fillLogArgs.senderAddress).to.eq(coordinatorContract.address);
expect(fillLogArgs.feeRecipientAddress).to.eq(feeRecipientAddress);
expect(fillLogArgs.makerAssetData).to.eq(orders[0].makerAssetData);
expect(fillLogArgs.takerAssetData).to.eq(orders[0].takerAssetData);
expect(fillLogArgs.makerAssetFilledAmount).to.bignumber.eq(orders[0].makerAssetAmount);
expect(fillLogArgs.takerAssetFilledAmount).to.bignumber.eq(orders[0].takerAssetAmount);
expect(fillLogArgs.makerFeePaid).to.bignumber.eq(orders[0].makerFee);
expect(fillLogArgs.takerFeePaid).to.bignumber.eq(orders[0].takerFee);
expect(fillLogArgs.orderHash).to.eq(orderHashUtils.getOrderHashHex(orders[0]));
});
it(`${fnName} should revert with no approval signature`, async () => {
const orders = [await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = takerTransactionFactory.newSignedTransaction(data);
await expectTransactionFailedAsync(
coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
takerAddress,
transaction.signature,
[],
[],
{
from: takerAddress,
gas: devConstants.MAX_EXECUTE_TRANSACTION_GAS,
},
),
RevertReason.InvalidApprovalSignature,
);
});
it(`${fnName} should revert with an invalid approval signature`, async () => {
const orders = [await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = takerTransactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory.newSignedApproval(
transaction,
takerAddress,
approvalExpirationTimeSeconds,
);
const signature = `${approval.signature.slice(0, 4)}FFFFFFFF${approval.signature.slice(12)}`;
await expectTransactionFailedAsync(
coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
takerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[signature],
{ from: takerAddress },
),
RevertReason.InvalidApprovalSignature,
);
});
it(`${fnName} should revert with an expired approval`, async () => {
const orders = [await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = takerTransactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).minus(constants.TIME_BUFFER);
const approval = approvalFactory.newSignedApproval(
transaction,
takerAddress,
approvalExpirationTimeSeconds,
);
await expectTransactionFailedAsync(
coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
takerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: takerAddress },
),
RevertReason.ApprovalExpired,
);
});
it(`${fnName} should revert if not called by tx signer or approver`, async () => {
const orders = [await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = takerTransactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory.newSignedApproval(
transaction,
takerAddress,
approvalExpirationTimeSeconds,
);
await expectTransactionFailedAsync(
coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
takerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: owner },
),
RevertReason.InvalidOrigin,
);
});
}
});
describe('batch order fills', () => {
for (const fnName of [...constants.MARKET_FILL_FN_NAMES, ...constants.BATCH_FILL_FN_NAMES]) {
it(`${fnName} should fill the orders with a signed approval`, async () => {
const orders = [await orderFactory.newSignedOrderAsync(), await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = takerTransactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory.newSignedApproval(
transaction,
takerAddress,
approvalExpirationTimeSeconds,
);
const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync(
await coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
takerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: takerAddress, gas: devConstants.MAX_EXECUTE_TRANSACTION_GAS },
),
devConstants.AWAIT_TRANSACTION_MINED_MS,
);
const fillLogs = transactionReceipt.logs.filter(
log => (log as LogWithDecodedArgs<ExchangeFillEventArgs>).event === 'Fill',
);
expect(fillLogs.length).to.eq(orders.length);
orders.forEach((order, index) => {
const fillLogArgs = (fillLogs[index] as LogWithDecodedArgs<ExchangeFillEventArgs>).args;
expect(fillLogArgs.makerAddress).to.eq(makerAddress);
expect(fillLogArgs.takerAddress).to.eq(takerAddress);
expect(fillLogArgs.senderAddress).to.eq(coordinatorContract.address);
expect(fillLogArgs.feeRecipientAddress).to.eq(feeRecipientAddress);
expect(fillLogArgs.makerAssetData).to.eq(order.makerAssetData);
expect(fillLogArgs.takerAssetData).to.eq(order.takerAssetData);
expect(fillLogArgs.makerAssetFilledAmount).to.bignumber.eq(order.makerAssetAmount);
expect(fillLogArgs.takerAssetFilledAmount).to.bignumber.eq(order.takerAssetAmount);
expect(fillLogArgs.makerFeePaid).to.bignumber.eq(order.makerFee);
expect(fillLogArgs.takerFeePaid).to.bignumber.eq(order.takerFee);
expect(fillLogArgs.orderHash).to.eq(orderHashUtils.getOrderHashHex(order));
});
});
it(`${fnName} should fill the orders if called by approver`, async () => {
const orders = [await orderFactory.newSignedOrderAsync(), await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = takerTransactionFactory.newSignedTransaction(data);
const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync(
await coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
feeRecipientAddress,
transaction.signature,
[],
[],
{ from: feeRecipientAddress, gas: devConstants.MAX_EXECUTE_TRANSACTION_GAS },
),
devConstants.AWAIT_TRANSACTION_MINED_MS,
);
const fillLogs = transactionReceipt.logs.filter(
log => (log as LogWithDecodedArgs<ExchangeFillEventArgs>).event === 'Fill',
);
expect(fillLogs.length).to.eq(orders.length);
orders.forEach((order, index) => {
const fillLogArgs = (fillLogs[index] as LogWithDecodedArgs<ExchangeFillEventArgs>).args;
expect(fillLogArgs.makerAddress).to.eq(makerAddress);
expect(fillLogArgs.takerAddress).to.eq(takerAddress);
expect(fillLogArgs.senderAddress).to.eq(coordinatorContract.address);
expect(fillLogArgs.feeRecipientAddress).to.eq(feeRecipientAddress);
expect(fillLogArgs.makerAssetData).to.eq(order.makerAssetData);
expect(fillLogArgs.takerAssetData).to.eq(order.takerAssetData);
expect(fillLogArgs.makerAssetFilledAmount).to.bignumber.eq(order.makerAssetAmount);
expect(fillLogArgs.takerAssetFilledAmount).to.bignumber.eq(order.takerAssetAmount);
expect(fillLogArgs.makerFeePaid).to.bignumber.eq(order.makerFee);
expect(fillLogArgs.takerFeePaid).to.bignumber.eq(order.takerFee);
expect(fillLogArgs.orderHash).to.eq(orderHashUtils.getOrderHashHex(order));
});
});
it(`${fnName} should revert with an invalid approval signature`, async () => {
const orders = [await orderFactory.newSignedOrderAsync(), await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = takerTransactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory.newSignedApproval(
transaction,
takerAddress,
approvalExpirationTimeSeconds,
);
const signature = `${approval.signature.slice(0, 4)}FFFFFFFF${approval.signature.slice(12)}`;
await expectTransactionFailedAsync(
coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
takerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[signature],
{ from: takerAddress },
),
RevertReason.InvalidApprovalSignature,
);
});
it(`${fnName} should revert with an expired approval`, async () => {
const orders = [await orderFactory.newSignedOrderAsync(), await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = takerTransactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).minus(constants.TIME_BUFFER);
const approval = approvalFactory.newSignedApproval(
transaction,
takerAddress,
approvalExpirationTimeSeconds,
);
await expectTransactionFailedAsync(
coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
takerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: takerAddress },
),
RevertReason.ApprovalExpired,
);
});
it(`${fnName} should revert if not called by tx signer or approver`, async () => {
const orders = [await orderFactory.newSignedOrderAsync(), await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = takerTransactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory.newSignedApproval(
transaction,
takerAddress,
approvalExpirationTimeSeconds,
);
await expectTransactionFailedAsync(
coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
takerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: owner },
),
RevertReason.InvalidOrigin,
);
});
}
});
describe('cancels', () => {
it('cancelOrder call should be successful without an approval', async () => {
const orders = [await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(constants.CANCEL_ORDER, orders);
const transaction = makerTransactionFactory.newSignedTransaction(data);
const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync(
await coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
makerAddress,
transaction.signature,
[],
[],
{
from: makerAddress,
},
),
);
const cancelLogs = transactionReceipt.logs.filter(
log => (log as LogWithDecodedArgs<ExchangeCancelEventArgs>).event === 'Cancel',
);
expect(cancelLogs.length).to.eq(1);
const cancelLogArgs = (cancelLogs[0] as LogWithDecodedArgs<ExchangeCancelEventArgs>).args;
expect(cancelLogArgs.makerAddress).to.eq(makerAddress);
expect(cancelLogArgs.senderAddress).to.eq(coordinatorContract.address);
expect(cancelLogArgs.feeRecipientAddress).to.eq(feeRecipientAddress);
expect(cancelLogArgs.makerAssetData).to.eq(orders[0].makerAssetData);
expect(cancelLogArgs.takerAssetData).to.eq(orders[0].takerAssetData);
expect(cancelLogArgs.orderHash).to.eq(orderHashUtils.getOrderHashHex(orders[0]));
});
it('batchCancelOrders call should be successful without an approval', async () => {
const orders = [await orderFactory.newSignedOrderAsync(), await orderFactory.newSignedOrderAsync()];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(constants.BATCH_CANCEL_ORDERS, orders);
const transaction = makerTransactionFactory.newSignedTransaction(data);
const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync(
await coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
makerAddress,
transaction.signature,
[],
[],
{
from: makerAddress,
},
),
);
const cancelLogs = transactionReceipt.logs.filter(
log => (log as LogWithDecodedArgs<ExchangeCancelEventArgs>).event === 'Cancel',
);
expect(cancelLogs.length).to.eq(orders.length);
orders.forEach((order, index) => {
const cancelLogArgs = (cancelLogs[index] as LogWithDecodedArgs<ExchangeCancelEventArgs>).args;
expect(cancelLogArgs.makerAddress).to.eq(makerAddress);
expect(cancelLogArgs.senderAddress).to.eq(coordinatorContract.address);
expect(cancelLogArgs.feeRecipientAddress).to.eq(feeRecipientAddress);
expect(cancelLogArgs.makerAssetData).to.eq(order.makerAssetData);
expect(cancelLogArgs.takerAssetData).to.eq(order.takerAssetData);
expect(cancelLogArgs.orderHash).to.eq(orderHashUtils.getOrderHashHex(order));
});
});
it('cancelOrdersUpTo call should be successful without an approval', async () => {
const orders: SignedOrder[] = [];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(constants.CANCEL_ORDERS_UP_TO, orders);
const transaction = makerTransactionFactory.newSignedTransaction(data);
const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync(
await coordinatorContract.executeTransaction.sendTransactionAsync(
transaction,
makerAddress,
transaction.signature,
[],
[],
{
from: makerAddress,
},
),
);
const cancelLogs = transactionReceipt.logs.filter(
log => (log as LogWithDecodedArgs<ExchangeCancelUpToEventArgs>).event === 'CancelUpTo',
);
expect(cancelLogs.length).to.eq(1);
const cancelLogArgs = (cancelLogs[0] as LogWithDecodedArgs<ExchangeCancelUpToEventArgs>).args;
expect(cancelLogArgs.makerAddress).to.eq(makerAddress);
expect(cancelLogArgs.senderAddress).to.eq(coordinatorContract.address);
expect(cancelLogArgs.orderEpoch).to.bignumber.eq(new BigNumber(1));
});
});
});
// tslint:disable:max-file-line-count

View File

@@ -0,0 +1,81 @@
import { artifacts as exchangeArtifacts } from '@0x/contracts-exchange';
import { chaiSetup, provider, web3Wrapper } from '@0x/contracts-test-utils';
import { BlockchainLifecycle } from '@0x/dev-utils';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import { CoordinatorRegistryCoordinatorEndpointSetEventArgs } from '../src';
import { CoordinatorRegistryWrapper } from './utils/coordinator_registry_wrapper';
chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
web3Wrapper.abiDecoder.addABI(exchangeArtifacts.Exchange.compilerOutput.abi);
// tslint:disable:no-unnecessary-type-assertion
describe('Coordinator Registry tests', () => {
let coordinatorOperator: string;
const coordinatorEndpoint = 'http://sometec.0x.org';
const nilCoordinatorEndpoint = '';
let coordinatorRegistryWrapper: CoordinatorRegistryWrapper;
// tests
before(async () => {
await blockchainLifecycle.startAsync();
});
after(async () => {
await blockchainLifecycle.revertAsync();
});
before(async () => {
// setup accounts (skip owner)
const accounts = await web3Wrapper.getAvailableAddressesAsync();
[, coordinatorOperator] = accounts;
// deploy coordinator registry
coordinatorRegistryWrapper = new CoordinatorRegistryWrapper(provider);
await coordinatorRegistryWrapper.deployCoordinatorRegistryAsync();
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();
});
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
describe('core', () => {
it('Should successfully set a Coordinator endpoint', async () => {
await coordinatorRegistryWrapper.setCoordinatorEndpointAsync(coordinatorOperator, coordinatorEndpoint);
const recordedCoordinatorEndpoint = await coordinatorRegistryWrapper.getCoordinatorEndpointAsync(
coordinatorOperator,
);
expect(recordedCoordinatorEndpoint).to.be.equal(coordinatorEndpoint);
});
it('Should successfully unset a Coordinator endpoint', async () => {
// set Coordinator endpoint
await coordinatorRegistryWrapper.setCoordinatorEndpointAsync(coordinatorOperator, coordinatorEndpoint);
let recordedCoordinatorEndpoint = await coordinatorRegistryWrapper.getCoordinatorEndpointAsync(
coordinatorOperator,
);
expect(recordedCoordinatorEndpoint).to.be.equal(coordinatorEndpoint);
// unset Coordinator endpoint
await coordinatorRegistryWrapper.setCoordinatorEndpointAsync(coordinatorOperator, nilCoordinatorEndpoint);
recordedCoordinatorEndpoint = await coordinatorRegistryWrapper.getCoordinatorEndpointAsync(
coordinatorOperator,
);
expect(recordedCoordinatorEndpoint).to.be.equal(nilCoordinatorEndpoint);
});
it('Should emit an event when setting Coordinator endpoint', async () => {
// set Coordinator endpoint
const txReceipt = await coordinatorRegistryWrapper.setCoordinatorEndpointAsync(
coordinatorOperator,
coordinatorEndpoint,
);
const recordedCoordinatorEndpoint = await coordinatorRegistryWrapper.getCoordinatorEndpointAsync(
coordinatorOperator,
);
expect(recordedCoordinatorEndpoint).to.be.equal(coordinatorEndpoint);
// validate event
expect(txReceipt.logs.length).to.be.equal(1);
const log = txReceipt.logs[0] as LogWithDecodedArgs<CoordinatorRegistryCoordinatorEndpointSetEventArgs>;
expect(log.args.coordinatorOperator).to.be.equal(coordinatorOperator);
expect(log.args.coordinatorEndpoint).to.be.equal(coordinatorEndpoint);
});
});
});

View File

@@ -1,9 +1,12 @@
import { env, EnvVars } from '@0x/dev-utils';
import { coverage } from './utils/coverage';
import { profiler } from './utils/profiler';
import { coverage, profiler, provider } from '@0x/contracts-test-utils';
import { providerUtils } from '@0x/utils';
after('generate coverage || profiler report', async () => {
before('start web3 provider', () => {
providerUtils.startProviderEngine(provider);
});
after('generate coverage report', async () => {
if (env.parseBoolean(EnvVars.SolidityCoverage)) {
const coverageSubprovider = coverage.getCoverageSubproviderSingleton();
await coverageSubprovider.writeCoverageAsync();
@@ -12,4 +15,5 @@ after('generate coverage || profiler report', async () => {
const profilerSubprovider = profiler.getProfilerSubproviderSingleton();
await profilerSubprovider.writeProfilerOutputAsync();
}
provider.stop();
});

View File

@@ -0,0 +1,80 @@
import { addressUtils, chaiSetup, constants, provider, txDefaults, web3Wrapper } from '@0x/contracts-test-utils';
import { BlockchainLifecycle } from '@0x/dev-utils';
import { transactionHashUtils } from '@0x/order-utils';
import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { artifacts, CoordinatorContract, hashUtils } from '../src';
chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
describe('Libs tests', () => {
let coordinatorContract: CoordinatorContract;
const exchangeAddress = addressUtils.generatePseudoRandomAddress();
before(async () => {
await blockchainLifecycle.startAsync();
});
after(async () => {
await blockchainLifecycle.revertAsync();
});
before(async () => {
coordinatorContract = await CoordinatorContract.deployFrom0xArtifactAsync(
artifacts.Coordinator,
provider,
txDefaults,
artifacts,
exchangeAddress,
);
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();
});
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
describe('getTransactionHash', () => {
it('should return the correct transaction hash', async () => {
const tx = {
verifyingContractAddress: exchangeAddress,
salt: new BigNumber(0),
signerAddress: constants.NULL_ADDRESS,
data: '0x1234',
};
const expectedTxHash = transactionHashUtils.getTransactionHashHex(tx);
const txHash = await coordinatorContract.getTransactionHash.callAsync(tx);
expect(expectedTxHash).to.eq(txHash);
});
});
describe('getApprovalHash', () => {
it('should return the correct approval hash', async () => {
const signedTx = {
verifyingContractAddress: exchangeAddress,
salt: new BigNumber(0),
signerAddress: constants.NULL_ADDRESS,
data: '0x1234',
signature: '0x5678',
};
const approvalExpirationTimeSeconds = new BigNumber(0);
const txOrigin = constants.NULL_ADDRESS;
const approval = {
txOrigin,
transactionHash: transactionHashUtils.getTransactionHashHex(signedTx),
transactionSignature: signedTx.signature,
approvalExpirationTimeSeconds,
};
const expectedApprovalHash = hashUtils.getApprovalHashHex(
signedTx,
coordinatorContract.address,
txOrigin,
approvalExpirationTimeSeconds,
);
const approvalHash = await coordinatorContract.getCoordinatorApprovalHash.callAsync(approval);
expect(expectedApprovalHash).to.eq(approvalHash);
});
});
});

View File

@@ -0,0 +1,729 @@
import {
addressUtils,
chaiSetup,
constants as devConstants,
expectContractCallFailedAsync,
getLatestBlockTimestampAsync,
provider,
TransactionFactory,
txDefaults,
web3Wrapper,
} from '@0x/contracts-test-utils';
import { BlockchainLifecycle } from '@0x/dev-utils';
import { transactionHashUtils } from '@0x/order-utils';
import { RevertReason, SignatureType, SignedOrder } from '@0x/types';
import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import * as ethUtil from 'ethereumjs-util';
import { ApprovalFactory, artifacts, constants, CoordinatorContract, exchangeDataEncoder } from '../src';
chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
describe('Mixins tests', () => {
let transactionSignerAddress: string;
let approvalSignerAddress1: string;
let approvalSignerAddress2: string;
let mixins: CoordinatorContract;
let transactionFactory: TransactionFactory;
let approvalFactory1: ApprovalFactory;
let approvalFactory2: ApprovalFactory;
let defaultOrder: SignedOrder;
const exchangeAddress = addressUtils.generatePseudoRandomAddress();
before(async () => {
await blockchainLifecycle.startAsync();
});
after(async () => {
await blockchainLifecycle.revertAsync();
});
before(async () => {
mixins = await CoordinatorContract.deployFrom0xArtifactAsync(
artifacts.Coordinator,
provider,
txDefaults,
artifacts,
exchangeAddress,
);
const accounts = await web3Wrapper.getAvailableAddressesAsync();
[transactionSignerAddress, approvalSignerAddress1, approvalSignerAddress2] = accounts.slice(0, 3);
defaultOrder = {
exchangeAddress: devConstants.NULL_ADDRESS,
makerAddress: devConstants.NULL_ADDRESS,
takerAddress: devConstants.NULL_ADDRESS,
senderAddress: mixins.address,
feeRecipientAddress: approvalSignerAddress1,
makerAssetData: devConstants.NULL_BYTES,
takerAssetData: devConstants.NULL_BYTES,
makerAssetAmount: devConstants.ZERO_AMOUNT,
takerAssetAmount: devConstants.ZERO_AMOUNT,
makerFee: devConstants.ZERO_AMOUNT,
takerFee: devConstants.ZERO_AMOUNT,
expirationTimeSeconds: devConstants.ZERO_AMOUNT,
salt: devConstants.ZERO_AMOUNT,
signature: devConstants.NULL_BYTES,
};
const transactionSignerPrivateKey =
devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(transactionSignerAddress)];
const approvalSignerPrivateKey1 = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(approvalSignerAddress1)];
const approvalSignerPrivateKey2 = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(approvalSignerAddress2)];
transactionFactory = new TransactionFactory(transactionSignerPrivateKey, exchangeAddress);
approvalFactory1 = new ApprovalFactory(approvalSignerPrivateKey1, mixins.address);
approvalFactory2 = new ApprovalFactory(approvalSignerPrivateKey2, mixins.address);
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();
});
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
describe('getSignerAddress', () => {
it('should return the correct address using the EthSign signature type', async () => {
const data = devConstants.NULL_BYTES;
const transaction = transactionFactory.newSignedTransaction(data, SignatureType.EthSign);
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
const signerAddress = await mixins.getSignerAddress.callAsync(transactionHash, transaction.signature);
expect(transaction.signerAddress).to.eq(signerAddress);
});
it('should return the correct address using the EIP712 signature type', async () => {
const data = devConstants.NULL_BYTES;
const transaction = transactionFactory.newSignedTransaction(data, SignatureType.EIP712);
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
const signerAddress = await mixins.getSignerAddress.callAsync(transactionHash, transaction.signature);
expect(transaction.signerAddress).to.eq(signerAddress);
});
it('should revert with with the Illegal signature type', async () => {
const data = devConstants.NULL_BYTES;
const transaction = transactionFactory.newSignedTransaction(data);
const illegalSignatureByte = ethUtil.toBuffer(SignatureType.Illegal).toString('hex');
transaction.signature = `${transaction.signature.slice(
0,
transaction.signature.length - 2,
)}${illegalSignatureByte}`;
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
expectContractCallFailedAsync(
mixins.getSignerAddress.callAsync(transactionHash, transaction.signature),
RevertReason.SignatureIllegal,
);
});
it('should revert with with the Invalid signature type', async () => {
const data = devConstants.NULL_BYTES;
const transaction = transactionFactory.newSignedTransaction(data);
const invalidSignatureByte = ethUtil.toBuffer(SignatureType.Invalid).toString('hex');
transaction.signature = `0x${invalidSignatureByte}`;
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
expectContractCallFailedAsync(
mixins.getSignerAddress.callAsync(transactionHash, transaction.signature),
RevertReason.SignatureInvalid,
);
});
it("should revert with with a signature type that doesn't exist", async () => {
const data = devConstants.NULL_BYTES;
const transaction = transactionFactory.newSignedTransaction(data);
const invalidSignatureByte = '04';
transaction.signature = `${transaction.signature.slice(
0,
transaction.signature.length - 2,
)}${invalidSignatureByte}`;
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
expectContractCallFailedAsync(
mixins.getSignerAddress.callAsync(transactionHash, transaction.signature),
RevertReason.SignatureUnsupported,
);
});
});
describe('decodeOrdersFromFillData', () => {
for (const fnName of constants.SINGLE_FILL_FN_NAMES) {
it(`should correctly decode the orders for ${fnName} data`, async () => {
const orders = [defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const decodedOrders = await mixins.decodeOrdersFromFillData.callAsync(data);
const decodedSignedOrders = decodedOrders.map(order => ({
...order,
exchangeAddress: devConstants.NULL_ADDRESS,
signature: devConstants.NULL_BYTES,
}));
expect(orders).to.deep.eq(decodedSignedOrders);
});
}
for (const fnName of constants.BATCH_FILL_FN_NAMES) {
it(`should correctly decode the orders for ${fnName} data`, async () => {
const orders = [defaultOrder, defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const decodedOrders = await mixins.decodeOrdersFromFillData.callAsync(data);
const decodedSignedOrders = decodedOrders.map(order => ({
...order,
exchangeAddress: devConstants.NULL_ADDRESS,
signature: devConstants.NULL_BYTES,
}));
expect(orders).to.deep.eq(decodedSignedOrders);
});
}
for (const fnName of constants.MARKET_FILL_FN_NAMES) {
it(`should correctly decode the orders for ${fnName} data`, async () => {
const orders = [defaultOrder, defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const decodedOrders = await mixins.decodeOrdersFromFillData.callAsync(data);
const decodedSignedOrders = decodedOrders.map(order => ({
...order,
exchangeAddress: devConstants.NULL_ADDRESS,
signature: devConstants.NULL_BYTES,
}));
expect(orders).to.deep.eq(decodedSignedOrders);
});
}
for (const fnName of [constants.CANCEL_ORDER, constants.BATCH_CANCEL_ORDERS, constants.CANCEL_ORDERS_UP_TO]) {
it(`should correctly decode the orders for ${fnName} data`, async () => {
const orders = [defaultOrder, defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const decodedOrders = await mixins.decodeOrdersFromFillData.callAsync(data);
const emptyArray: any[] = [];
expect(emptyArray).to.deep.eq(decodedOrders);
});
}
it('should decode an empty array for invalid data', async () => {
const data = '0x0123456789';
const decodedOrders = await mixins.decodeOrdersFromFillData.callAsync(data);
const emptyArray: any[] = [];
expect(emptyArray).to.deep.eq(decodedOrders);
});
it('should revert if data is less than 4 bytes long', async () => {
const data = '0x010203';
await expectContractCallFailedAsync(
mixins.decodeOrdersFromFillData.callAsync(data),
RevertReason.LibBytesGreaterOrEqualTo4LengthRequired,
);
});
});
describe('Single order approvals', () => {
for (const fnName of constants.SINGLE_FILL_FN_NAMES) {
it(`Should be successful: function=${fnName}, caller=tx_signer, senderAddress=[verifier], approval_sig=[approver1], expiration=[valid]`, async () => {
const orders = [defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: transactionSignerAddress },
);
});
it(`Should be successful: function=${fnName}, caller=tx_signer, senderAddress=[null], approval_sig=[approver1], expiration=[valid]`, async () => {
const order = {
...defaultOrder,
senderAddress: devConstants.NULL_ADDRESS,
};
const orders = [order];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: transactionSignerAddress },
);
});
it(`Should be successful: function=${fnName}, caller=approver1, senderAddress=[verifier], approval_sig=[], expiration=[]`, async () => {
const orders = [defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
approvalSignerAddress1,
transaction.signature,
[],
[],
{
from: approvalSignerAddress1,
},
);
});
it(`Should be successful: function=${fnName}, caller=approver1, senderAddress=[verifier], approval_sig=[approver1], expiration=[invalid]`, async () => {
const orders = [defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
approvalSignerAddress1,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: approvalSignerAddress1 },
);
});
it(`Should be successful: function=${fnName}, caller=approver1, senderAddress=[verifier], approval_sig=[], expiration=[]`, async () => {
const orders = [defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
approvalSignerAddress1,
transaction.signature,
[],
[],
{
from: approvalSignerAddress1,
},
);
});
it(`Should revert: function=${fnName}, caller=tx_signer, senderAddress=[verifier], approval_sig=[invalid], expiration=[valid]`, async () => {
const orders = [defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
const signature = `${approval.signature.slice(0, 4)}FFFFFFFF${approval.signature.slice(12)}`;
expectContractCallFailedAsync(
mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[signature],
{ from: transactionSignerAddress },
),
RevertReason.InvalidApprovalSignature,
);
});
it(`Should revert: function=${fnName}, caller=tx_signer, senderAddress=[verifier], approval_sig=[approver1], expiration=[invalid]`, async () => {
const orders = [defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).minus(constants.TIME_BUFFER);
const approval = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
expectContractCallFailedAsync(
mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: transactionSignerAddress },
),
RevertReason.ApprovalExpired,
);
});
it(`Should revert: function=${fnName}, caller=approver2, senderAddress=[verifier], approval_sig=[approver1], expiration=[valid]`, async () => {
const orders = [defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
expectContractCallFailedAsync(
mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: approvalSignerAddress2 },
),
RevertReason.InvalidOrigin,
);
});
}
});
describe('Batch order approvals', () => {
for (const fnName of [
...constants.BATCH_FILL_FN_NAMES,
...constants.MARKET_FILL_FN_NAMES,
constants.MATCH_ORDERS,
]) {
it(`Should be successful: function=${fnName} caller=tx_signer, senderAddress=[verifier,verifier], feeRecipient=[approver1,approver1], approval_sig=[approver1], expiration=[valid]`, async () => {
const orders = [defaultOrder, defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: transactionSignerAddress },
);
});
it(`Should be successful: function=${fnName} caller=tx_signer, senderAddress=[null,null], feeRecipient=[approver1,approver1], approval_sig=[approver1], expiration=[valid]`, async () => {
const orders = [defaultOrder, defaultOrder].map(order => ({
...order,
senderAddress: devConstants.NULL_ADDRESS,
}));
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: transactionSignerAddress },
);
});
it(`Should be successful: function=${fnName} caller=tx_signer, senderAddress=[null,null], feeRecipient=[approver1,approver1], approval_sig=[], expiration=[]`, async () => {
const orders = [defaultOrder, defaultOrder].map(order => ({
...order,
senderAddress: devConstants.NULL_ADDRESS,
}));
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[],
[],
{ from: transactionSignerAddress },
);
});
it(`Should be successful: function=${fnName} caller=tx_signer, senderAddress=[verifier,null], feeRecipient=[approver1,approver1], approval_sig=[approver1], expiration=[valid]`, async () => {
const orders = [defaultOrder, { ...defaultOrder, senderAddress: devConstants.NULL_ADDRESS }];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval.signature],
{ from: transactionSignerAddress },
);
});
it(`Should be successful: function=${fnName} caller=tx_signer, senderAddress=[verifier,verifier], feeRecipient=[approver1,approver2], approval_sig=[approver1,approver2], expiration=[valid,valid]`, async () => {
const orders = [defaultOrder, { ...defaultOrder, feeRecipientAddress: approvalSignerAddress2 }];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval1 = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
const approval2 = approvalFactory2.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds, approvalExpirationTimeSeconds],
[approval1.signature, approval2.signature],
{ from: transactionSignerAddress },
);
});
it(`Should be successful: function=${fnName} caller=approver1, senderAddress=[verifier,verifier], feeRecipient=[approver1,approver1], approval_sig=[], expiration=[]`, async () => {
const orders = [defaultOrder, defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
approvalSignerAddress1,
transaction.signature,
[],
[],
{ from: approvalSignerAddress1 },
);
});
it(`Should revert: function=${fnName} caller=approver1, senderAddress=[verifier,verifier], feeRecipient=[approver1,approver2], approval_sig=[approver2], expiration=[valid]`, async () => {
const orders = [defaultOrder, { ...defaultOrder, feeRecipientAddress: approvalSignerAddress2 }];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval2 = approvalFactory2.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
expectContractCallFailedAsync(
mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval2.signature],
{ from: approvalSignerAddress1 },
),
RevertReason.InvalidOrigin,
);
});
it(`Should revert: function=${fnName} caller=tx_signer, senderAddress=[verifier,verifier], feeRecipient=[approver1, approver1], approval_sig=[], expiration=[]`, async () => {
const orders = [defaultOrder, defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
expectContractCallFailedAsync(
mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[],
[],
{ from: transactionSignerAddress },
),
RevertReason.InvalidApprovalSignature,
);
});
it(`Should revert: function=${fnName} caller=tx_signer, senderAddress=[verifier,verifier], feeRecipient=[approver1, approver1], approval_sig=[invalid], expiration=[valid]`, async () => {
const orders = [defaultOrder, defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
const signature = `${approval.signature.slice(0, 4)}FFFFFFFF${approval.signature.slice(12)}`;
expectContractCallFailedAsync(
mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[signature],
{ from: transactionSignerAddress },
),
RevertReason.InvalidApprovalSignature,
);
});
it(`Should revert: function=${fnName} caller=tx_signer, senderAddress=[verifier,verifier], feeRecipient=[approver1, approver2], approval_sig=[valid,invalid], expiration=[valid,valid]`, async () => {
const orders = [defaultOrder, { ...defaultOrder, feeRecipientAddress: approvalSignerAddress2 }];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval1 = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
const approval2 = approvalFactory2.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
const approvalSignature2 = `${approval2.signature.slice(0, 4)}FFFFFFFF${approval2.signature.slice(12)}`;
expectContractCallFailedAsync(
mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds, approvalExpirationTimeSeconds],
[approval1.signature, approvalSignature2],
{ from: transactionSignerAddress },
),
RevertReason.InvalidApprovalSignature,
);
});
it(`Should revert: function=${fnName} caller=approver1, senderAddress=[verifier,verifier], feeRecipient=[approver1, approver2], approval_sig=[invalid], expiration=[valid]`, async () => {
const orders = [defaultOrder, { ...defaultOrder, feeRecipientAddress: approvalSignerAddress2 }];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval2 = approvalFactory2.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
const approvalSignature2 = `${approval2.signature.slice(0, 4)}FFFFFFFF${approval2.signature.slice(12)}`;
expectContractCallFailedAsync(
mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
approvalSignerAddress1,
transaction.signature,
[approvalExpirationTimeSeconds],
[approvalSignature2],
{ from: approvalSignerAddress1 },
),
RevertReason.InvalidApprovalSignature,
);
});
it(`Should revert: function=${fnName} caller=tx_signer, senderAddress=[verifier,verifier], feeRecipient=[approver1, approver2], approval_sig=[valid,valid], expiration=[valid,invalid]`, async () => {
const orders = [defaultOrder, { ...defaultOrder, feeRecipientAddress: approvalSignerAddress2 }];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds1 = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approvalExpirationTimeSeconds2 = new BigNumber(currentTimestamp).minus(constants.TIME_BUFFER);
const approval1 = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds1,
);
const approval2 = approvalFactory2.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds2,
);
expectContractCallFailedAsync(
mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds1, approvalExpirationTimeSeconds2],
[approval1.signature, approval2.signature],
{ from: transactionSignerAddress },
),
RevertReason.ApprovalExpired,
);
});
it(`Should revert: function=${fnName} caller=approver1, senderAddress=[verifier,verifier], feeRecipient=[approver1, approver2], approval_sig=[valid], expiration=[invalid]`, async () => {
const orders = [defaultOrder, { ...defaultOrder, feeRecipientAddress: approvalSignerAddress2 }];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).minus(constants.TIME_BUFFER);
const approval2 = approvalFactory2.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
expectContractCallFailedAsync(
mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
approvalSignerAddress1,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval2.signature],
{ from: approvalSignerAddress1 },
),
RevertReason.ApprovalExpired,
);
});
it(`Should revert: function=${fnName} caller=approver2, senderAddress=[verifier,verifier], feeRecipient=[approver1, approver1], approval_sig=[valid], expiration=[valid]`, async () => {
const orders = [defaultOrder, defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = transactionFactory.newSignedTransaction(data);
const currentTimestamp = await getLatestBlockTimestampAsync();
const approvalExpirationTimeSeconds = new BigNumber(currentTimestamp).plus(constants.TIME_BUFFER);
const approval1 = approvalFactory1.newSignedApproval(
transaction,
transactionSignerAddress,
approvalExpirationTimeSeconds,
);
expectContractCallFailedAsync(
mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[approvalExpirationTimeSeconds],
[approval1.signature],
{ from: approvalSignerAddress2 },
),
RevertReason.InvalidOrigin,
);
});
}
});
describe('cancels', () => {
it('should allow the tx signer to call `cancelOrder` without approval', async () => {
const orders = [defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(constants.CANCEL_ORDER, orders);
const transaction = transactionFactory.newSignedTransaction(data);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[],
[],
{ from: transactionSignerAddress },
);
});
it('should allow the tx signer to call `batchCancelOrders` without approval', async () => {
const orders = [defaultOrder, defaultOrder];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(constants.BATCH_CANCEL_ORDERS, orders);
const transaction = transactionFactory.newSignedTransaction(data);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[],
[],
{ from: transactionSignerAddress },
);
});
it('should allow the tx signer to call `cancelOrdersUpTo` without approval', async () => {
const orders: SignedOrder[] = [];
const data = exchangeDataEncoder.encodeOrdersToExchangeData(constants.CANCEL_ORDERS_UP_TO, orders);
const transaction = transactionFactory.newSignedTransaction(data);
await mixins.assertValidCoordinatorApprovals.callAsync(
transaction,
transactionSignerAddress,
transaction.signature,
[],
[],
{ from: transactionSignerAddress },
);
});
});
});
// tslint:disable:max-file-line-count

View File

@@ -0,0 +1,38 @@
import { signingUtils } from '@0x/contracts-test-utils';
import { SignatureType, SignedZeroExTransaction } from '@0x/types';
import { BigNumber } from '@0x/utils';
import * as ethUtil from 'ethereumjs-util';
import { hashUtils, SignedCoordinatorApproval } from './index';
export class ApprovalFactory {
private readonly _privateKey: Buffer;
private readonly _verifyingContractAddress: string;
constructor(privateKey: Buffer, verifyingContractAddress: string) {
this._privateKey = privateKey;
this._verifyingContractAddress = verifyingContractAddress;
}
public newSignedApproval(
transaction: SignedZeroExTransaction,
txOrigin: string,
approvalExpirationTimeSeconds: BigNumber,
signatureType: SignatureType = SignatureType.EthSign,
): SignedCoordinatorApproval {
const approvalHashBuff = hashUtils.getApprovalHashBuffer(
transaction,
this._verifyingContractAddress,
txOrigin,
approvalExpirationTimeSeconds,
);
const signatureBuff = signingUtils.signMessage(approvalHashBuff, this._privateKey, signatureType);
const signedApproval = {
txOrigin,
transaction,
approvalExpirationTimeSeconds,
signature: ethUtil.addHexPrefix(signatureBuff.toString('hex')),
};
return signedApproval;
}
}

View File

@@ -0,0 +1,12 @@
import { BigNumber } from '@0x/utils';
export const constants = {
SINGLE_FILL_FN_NAMES: ['fillOrder', 'fillOrKillOrder', 'fillOrderNoThrow'],
BATCH_FILL_FN_NAMES: ['batchFillOrders', 'batchFillOrKillOrders', 'batchFillOrdersNoThrow'],
MARKET_FILL_FN_NAMES: ['marketBuyOrders', 'marketBuyOrdersNoThrow', 'marketSellOrders', 'marketSellOrdersNoThrow'],
MATCH_ORDERS: 'matchOrders',
CANCEL_ORDER: 'cancelOrder',
BATCH_CANCEL_ORDERS: 'batchCancelOrders',
CANCEL_ORDERS_UP_TO: 'cancelOrdersUpTo',
TIME_BUFFER: new BigNumber(1000),
};

View File

@@ -0,0 +1,65 @@
import { LogDecoder, txDefaults } from '@0x/contracts-test-utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { TransactionReceiptWithDecodedLogs, ZeroExProvider } from 'ethereum-types';
import { artifacts, CoordinatorRegistryContract } from '../../src';
export class CoordinatorRegistryWrapper {
private readonly _web3Wrapper: Web3Wrapper;
private readonly _provider: ZeroExProvider;
private readonly _logDecoder: LogDecoder;
private _coordinatorRegistryContract?: CoordinatorRegistryContract;
/**
* Instanitates an CoordinatorRegistryWrapper
* @param provider Web3 provider to use for all JSON RPC requests
* Instance of CoordinatorRegistryWrapper
*/
constructor(provider: ZeroExProvider) {
this._web3Wrapper = new Web3Wrapper(provider);
this._provider = provider;
this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts);
}
public async deployCoordinatorRegistryAsync(): Promise<CoordinatorRegistryContract> {
this._coordinatorRegistryContract = await CoordinatorRegistryContract.deployFrom0xArtifactAsync(
artifacts.CoordinatorRegistry,
this._provider,
txDefaults,
artifacts,
);
if (this._coordinatorRegistryContract === undefined) {
throw new Error(`Failed to deploy Coordinator Registry contract.`);
}
return this._coordinatorRegistryContract;
}
public async setCoordinatorEndpointAsync(
coordinatorOperator: string,
coordinatorEndpoint: string,
): Promise<TransactionReceiptWithDecodedLogs> {
this._assertCoordinatorRegistryDeployed();
const txReceipt = await this._logDecoder.getTxWithDecodedLogsAsync(
await (this
._coordinatorRegistryContract as CoordinatorRegistryContract).setCoordinatorEndpoint.sendTransactionAsync(
coordinatorEndpoint,
{
from: coordinatorOperator,
},
),
);
return txReceipt;
}
public async getCoordinatorEndpointAsync(coordinatorOperator: string): Promise<string> {
this._assertCoordinatorRegistryDeployed();
const coordinatorEndpoint = await (this
._coordinatorRegistryContract as CoordinatorRegistryContract).getCoordinatorEndpoint.callAsync(
coordinatorOperator,
);
return coordinatorEndpoint;
}
private _assertCoordinatorRegistryDeployed(): void {
if (this._coordinatorRegistryContract === undefined) {
throw new Error(
'The Coordinator Registry contract was not deployed through the CoordinatorRegistryWrapper. Call `deployCoordinatorRegistryAsync` to deploy.',
);
}
}
}

View File

@@ -0,0 +1,47 @@
import { IExchangeContract } from '@0x/contracts-exchange';
import { constants as devConstants, provider } from '@0x/contracts-test-utils';
import { SignedOrder } from '@0x/types';
import { constants } from './index';
export const exchangeDataEncoder = {
encodeOrdersToExchangeData(fnName: string, orders: SignedOrder[]): string {
const exchangeInstance = new IExchangeContract(devConstants.NULL_ADDRESS, provider);
let data;
if (constants.SINGLE_FILL_FN_NAMES.indexOf(fnName) !== -1) {
data = (exchangeInstance as any)[fnName].getABIEncodedTransactionData(
orders[0],
orders[0].takerAssetAmount,
orders[0].signature,
);
} else if (constants.BATCH_FILL_FN_NAMES.indexOf(fnName) !== -1) {
data = (exchangeInstance as any)[fnName].getABIEncodedTransactionData(
orders,
orders.map(order => order.takerAssetAmount),
orders.map(order => order.signature),
);
} else if (constants.MARKET_FILL_FN_NAMES.indexOf(fnName) !== -1) {
data = (exchangeInstance as any)[fnName].getABIEncodedTransactionData(
orders,
orders.map(order => order.takerAssetAmount).reduce((prev, curr) => prev.plus(curr)),
orders.map(order => order.signature),
);
} else if (fnName === constants.MATCH_ORDERS) {
data = exchangeInstance.matchOrders.getABIEncodedTransactionData(
orders[0],
orders[1],
orders[0].signature,
orders[1].signature,
);
} else if (fnName === constants.CANCEL_ORDER) {
data = exchangeInstance.cancelOrder.getABIEncodedTransactionData(orders[0]);
} else if (fnName === constants.BATCH_CANCEL_ORDERS) {
data = exchangeInstance.batchCancelOrders.getABIEncodedTransactionData(orders);
} else if (fnName === constants.CANCEL_ORDERS_UP_TO) {
data = exchangeInstance.cancelOrdersUpTo.getABIEncodedTransactionData(devConstants.ZERO_AMOUNT);
} else {
throw new Error(`Error: ${fnName} not a supported function`);
}
return data;
},
};

View File

@@ -0,0 +1,33 @@
import { eip712Utils } from '@0x/order-utils';
import { SignedZeroExTransaction } from '@0x/types';
import { BigNumber, signTypedDataUtils } from '@0x/utils';
import * as _ from 'lodash';
export const hashUtils = {
getApprovalHashBuffer(
transaction: SignedZeroExTransaction,
verifyingContractAddress: string,
txOrigin: string,
approvalExpirationTimeSeconds: BigNumber,
): Buffer {
const typedData = eip712Utils.createCoordinatorApprovalTypedData(
transaction,
verifyingContractAddress,
txOrigin,
approvalExpirationTimeSeconds,
);
const hashBuffer = signTypedDataUtils.generateTypedDataHash(typedData);
return hashBuffer;
},
getApprovalHashHex(
transaction: SignedZeroExTransaction,
verifyingContractAddress: string,
txOrigin: string,
approvalExpirationTimeSeconds: BigNumber,
): string {
const hashHex = `0x${hashUtils
.getApprovalHashBuffer(transaction, verifyingContractAddress, txOrigin, approvalExpirationTimeSeconds)
.toString('hex')}`;
return hashHex;
},
};

View File

@@ -0,0 +1,5 @@
export { hashUtils } from './hash_utils';
export { ApprovalFactory } from './approval_factory';
export { constants } from './constants';
export { exchangeDataEncoder } from './exchange_data_encoder';
export * from './types';

View File

@@ -0,0 +1,12 @@
import { SignedZeroExTransaction } from '@0x/types';
import { BigNumber } from '@0x/utils';
export interface CoordinatorApproval {
transaction: SignedZeroExTransaction;
txOrigin: string;
approvalExpirationTimeSeconds: BigNumber;
}
export interface SignedCoordinatorApproval extends CoordinatorApproval {
signature: string;
}

View File

@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig",
"compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true },
"include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"],
"files": ["generated-artifacts/Coordinator.json", "generated-artifacts/CoordinatorRegistry.json"],
"exclude": ["./deploy/solc/solc_bin"]
}

View File

@@ -0,0 +1,6 @@
{
"extends": ["@0x/tslint-config"],
"rules": {
"custom-no-magic-numbers": false
}
}

View File

@@ -0,0 +1,113 @@
[
{
"timestamp": 1567521715,
"version": "0.0.9",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"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",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.0.1",
"changes": [
{
"note": "Create dev-utils package",
"pr": 1848
},
{
"note": "Add `LibAssetData` and `LibTransactionDecoder` contracts",
"pr": 1848
},
{
"note": "Refactor `LibAssetData` to only check 0x-specific allowances",
"pr": 1848
},
{
"note": "Refactor `LibAssetData` balance/allowance checks to never revert",
"pr": 1848
},
{
"note": "Refactor `OrderValidationUtils` to calculate `fillableTakerAssetAmount`",
"pr": 1848
},
{
"note": "Add support for StaticCallProxy",
"pr": 1863
}
]
}
]

View File

@@ -0,0 +1,51 @@
<!--
changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
## v0.0.9 - _September 3, 2019_
* Dependencies updated
## 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
## v0.0.1 - _Invalid date_
* Create dev-utils package (#1848)
* Add `LibAssetData` and `LibTransactionDecoder` contracts (#1848)
* Refactor `LibAssetData` to only check 0x-specific allowances (#1848)
* Refactor `LibAssetData` balance/allowance checks to never revert (#1848)
* Refactor `OrderValidationUtils` to calculate `fillableTakerAssetAmount` (#1848)
* Add support for StaticCallProxy (#1863)

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,73 @@
## Dev-Utils
This package implements various utilities for developers. For example, the `DevUtils` contract can query batches of balances or allowances given some `assetData`, can validate batches of orders, and can decode 0x-specific calldata. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
## Installation
**Install**
```bash
npm install @0x/contracts-dev-utils --save
```
## Bug bounty
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
## Contributing
We strongly recommend that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository.
For proposals regarding the 0x protocol's smart contract architecture, message format, or additional functionality, go to the [0x Improvement Proposals (ZEIPs)](https://github.com/0xProject/ZEIPs) repository and follow the contribution guidelines provided therein.
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
### Install Dependencies
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
```bash
yarn config set workspaces-experimental true
```
Then install dependencies
```bash
yarn install
```
### Build
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
PKG=@0x/contracts-extensions yarn build
```
Or continuously rebuild on change:
```bash
PKG=@0x/contracts-extensions yarn watch
```
### Clean
```bash
yarn clean
```
### Lint
```bash
yarn lint
```
### Run Tests
```bash
yarn test
```
#### Testing options
Contracts testing options like coverage, profiling, revert traces or backing node choosing - are described [here](../TESTING.md).

View File

@@ -0,0 +1,32 @@
{
"artifactsDir": "./generated-artifacts",
"contractsDir": "./contracts",
"useDockerisedSolc": false,
"isOfflineMode": false,
"compilerSettings": {
"evmVersion": "constantinople",
"optimizer": {
"enabled": true,
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": {
"*": {
"*": [
"abi",
"devdoc",
"evm.bytecode.object",
"evm.bytecode.sourceMap",
"evm.deployedBytecode.object",
"evm.deployedBytecode.sourceMap"
]
}
}
},
"contracts": [
"src/DevUtils.sol",
"src/LibAssetData.sol",
"src/LibTransactionDecoder.sol",
"src/EthBalanceChecker.sol"
]
}

View File

@@ -0,0 +1,37 @@
/*
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;
pragma experimental ABIEncoderV2;
import "./OrderValidationUtils.sol";
import "./LibTransactionDecoder.sol";
import "./EthBalanceChecker.sol";
// solhint-disable no-empty-blocks
contract DevUtils is
OrderValidationUtils,
LibTransactionDecoder,
EthBalanceChecker
{
constructor (address _exchange, bytes memory _zrxAssetData)
public
OrderValidationUtils(_exchange, _zrxAssetData)
{}
}

View File

@@ -0,0 +1,39 @@
/*
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 EthBalanceChecker {
/// @dev Batch fetches ETH balances
/// @param addresses Array of addresses.
/// @return Array of ETH balances.
function getEthBalances(address[] memory addresses)
public
view
returns (uint256[] memory)
{
uint256[] memory balances = new uint256[](addresses.length);
for (uint256 i = 0; i != addresses.length; i++) {
balances[i] = addresses[i].balance;
}
return balances;
}
}

View File

@@ -0,0 +1,541 @@
/*
Copyright 2019 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;
pragma experimental ABIEncoderV2;
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
import "@0x/contracts-asset-proxy/contracts/src/libs/LibAssetProxyIds.sol";
import "@0x/contracts-exchange/contracts/src/interfaces/IExchange.sol";
contract LibAssetData is
LibAssetProxyIds
{
// 2^256 - 1
uint256 constant internal _MAX_UINT256 = uint256(-1);
// ERC20 selectors
bytes4 constant internal _ERC20_BALANCE_OF_SELECTOR = 0x70a08231;
bytes4 constant internal _ERC20_ALLOWANCE_SELECTOR = 0xdd62ed3e;
// ERC721 selectors
bytes4 constant internal _ERC721_OWNER_OF_SELECTOR = 0x6352211e;
bytes4 constant internal _ERC721_IS_APPROVED_FOR_ALL_SELECTOR = 0xe985e9c5;
bytes4 constant internal _ERC721_GET_APPROVED_SELECTOR = 0x081812fc;
// ERC1155 selectors
bytes4 constant internal _ERC1155_BALANCE_OF_SELECTOR = 0x00fdd58e;
bytes4 constant internal _ERC1155_IS_APPROVED_FOR_ALL_SELECTOR = 0xe985e9c5;
// `transferFrom` selector for all AssetProxy contracts
bytes4 constant internal _ASSET_PROXY_TRANSFER_FROM_SELECTOR = 0xa85e59e4;
using LibBytes for bytes;
// solhint-disable var-name-mixedcase
IExchange internal _EXCHANGE;
address internal _ERC20_PROXY_ADDRESS;
address internal _ERC721_PROXY_ADDRESS;
address internal _ERC1155_PROXY_ADDRESS;
address internal _STATIC_CALL_PROXY_ADDRESS;
// solhint-enable var-name-mixedcase
constructor (address _exchange)
public
{
_EXCHANGE = IExchange(_exchange);
_ERC20_PROXY_ADDRESS = _EXCHANGE.getAssetProxy(ERC20_PROXY_ID);
_ERC721_PROXY_ADDRESS = _EXCHANGE.getAssetProxy(ERC721_PROXY_ID);
_ERC1155_PROXY_ADDRESS = _EXCHANGE.getAssetProxy(ERC1155_PROXY_ID);
_STATIC_CALL_PROXY_ADDRESS = _EXCHANGE.getAssetProxy(STATIC_CALL_PROXY_ID);
}
/// @dev Returns the owner's balance of the assets(s) specified in
/// assetData. When the asset data contains multiple assets (eg in
/// ERC1155 or Multi-Asset), the return value indicates how many
/// complete "baskets" of those assets are owned by owner.
/// @param ownerAddress Owner of the assets specified by assetData.
/// @param assetData Details of asset, encoded per the AssetProxy contract specification.
/// @return Number of assets (or asset baskets) held by owner.
function getBalance(address ownerAddress, bytes memory assetData)
public
view
returns (uint256 balance)
{
// Get id of AssetProxy contract
bytes4 assetProxyId = assetData.readBytes4(0);
if (assetProxyId == ERC20_PROXY_ID) {
// Get ERC20 token address
address tokenAddress = assetData.readAddress(16);
// Encode data for `balanceOf(ownerAddress)`
bytes memory balanceOfData = abi.encodeWithSelector(_ERC20_BALANCE_OF_SELECTOR, ownerAddress);
// Query balance
(bool success, bytes memory returnData) = tokenAddress.staticcall(balanceOfData);
balance = success && returnData.length == 32 ? returnData.readUint256(0) : 0;
} else if (assetProxyId == ERC721_PROXY_ID) {
// Get ERC721 token address and id
(, address tokenAddress, uint256 tokenId) = decodeERC721AssetData(assetData);
// Check if id is owned by ownerAddress
balance = getERC721TokenOwner(tokenAddress, tokenId) == ownerAddress ? 1 : 0;
} else if (assetProxyId == ERC1155_PROXY_ID) {
// Get ERC1155 token address, array of ids, and array of values
(, address tokenAddress, uint256[] memory tokenIds, uint256[] memory tokenValues,) = decodeERC1155AssetData(assetData);
uint256 length = tokenIds.length;
for (uint256 i = 0; i != length; i++) {
// Encode data for `balanceOf(ownerAddress, tokenIds[i])
bytes memory balanceOfData = abi.encodeWithSelector(
_ERC1155_BALANCE_OF_SELECTOR,
ownerAddress,
tokenIds[i]
);
// Query balance
(bool success, bytes memory returnData) = tokenAddress.staticcall(balanceOfData);
uint256 totalBalance = success && returnData.length == 32 ? returnData.readUint256(0) : 0;
// Scale total balance down by corresponding value in assetData
uint256 scaledBalance = totalBalance / tokenValues[i];
if (scaledBalance < balance || balance == 0) {
balance = scaledBalance;
}
}
} else if (assetProxyId == STATIC_CALL_PROXY_ID) {
// Encode data for `staticCallProxy.transferFrom(assetData,...)`
bytes memory transferFromData = abi.encodeWithSelector(
_ASSET_PROXY_TRANSFER_FROM_SELECTOR,
assetData,
address(0), // `from` address is not used
address(0), // `to` address is not used
0 // `amount` is not used
);
// Check if staticcall would be successful
(bool success,) = _STATIC_CALL_PROXY_ADDRESS.staticcall(transferFromData);
// Success means that the staticcall can be made an unlimited amount of times
balance = success ? _MAX_UINT256 : 0;
} else if (assetProxyId == MULTI_ASSET_PROXY_ID) {
// Get array of values and array of assetDatas
(, uint256[] memory assetAmounts, bytes[] memory nestedAssetData) = decodeMultiAssetData(assetData);
uint256 length = nestedAssetData.length;
for (uint256 i = 0; i != length; i++) {
// Query balance of individual assetData
uint256 totalBalance = getBalance(ownerAddress, nestedAssetData[i]);
// Scale total balance down by corresponding value in assetData
uint256 scaledBalance = totalBalance / assetAmounts[i];
if (scaledBalance < balance || balance == 0) {
balance = scaledBalance;
}
}
}
// Balance will be 0 if assetProxyId is unknown
return balance;
}
/// @dev Calls getBalance() for each element of assetData.
/// @param ownerAddress Owner of the assets specified by assetData.
/// @param assetData Array of asset details, each encoded per the AssetProxy contract specification.
/// @return Array of asset balances from getBalance(), with each element
/// corresponding to the same-indexed element in the assetData input.
function getBatchBalances(address ownerAddress, bytes[] memory assetData)
public
view
returns (uint256[] memory balances)
{
uint256 length = assetData.length;
balances = new uint256[](length);
for (uint256 i = 0; i != length; i++) {
balances[i] = getBalance(ownerAddress, assetData[i]);
}
return balances;
}
/// @dev Returns the number of asset(s) (described by assetData) that
/// the corresponding AssetProxy contract is authorized to spend. When the asset data contains
/// multiple assets (eg for Multi-Asset), the return value indicates
/// how many complete "baskets" of those assets may be spent by all of the corresponding
/// AssetProxy contracts.
/// @param ownerAddress Owner of the assets specified by assetData.
/// @param assetData Details of asset, encoded per the AssetProxy contract specification.
/// @return Number of assets (or asset baskets) that the corresponding AssetProxy is authorized to spend.
function getAssetProxyAllowance(address ownerAddress, bytes memory assetData)
public
view
returns (uint256 allowance)
{
// Get id of AssetProxy contract
bytes4 assetProxyId = assetData.readBytes4(0);
if (assetProxyId == MULTI_ASSET_PROXY_ID) {
// Get array of values and array of assetDatas
(, uint256[] memory amounts, bytes[] memory nestedAssetData) = decodeMultiAssetData(assetData);
uint256 length = nestedAssetData.length;
for (uint256 i = 0; i != length; i++) {
// Query allowance of individual assetData
uint256 totalAllowance = getAssetProxyAllowance(ownerAddress, nestedAssetData[i]);
// Scale total allowance down by corresponding value in assetData
uint256 scaledAllowance = totalAllowance / amounts[i];
if (scaledAllowance < allowance || allowance == 0) {
allowance = scaledAllowance;
}
}
return allowance;
}
if (assetProxyId == ERC20_PROXY_ID) {
// Get ERC20 token address
address tokenAddress = assetData.readAddress(16);
// Encode data for `allowance(ownerAddress, _ERC20_PROXY_ADDRESS)`
bytes memory allowanceData = abi.encodeWithSelector(
_ERC20_ALLOWANCE_SELECTOR,
ownerAddress,
_ERC20_PROXY_ADDRESS
);
// Query allowance
(bool success, bytes memory returnData) = tokenAddress.staticcall(allowanceData);
allowance = success && returnData.length == 32 ? returnData.readUint256(0) : 0;
} else if (assetProxyId == ERC721_PROXY_ID) {
// Get ERC721 token address and id
(, address tokenAddress, uint256 tokenId) = decodeERC721AssetData(assetData);
// Encode data for `isApprovedForAll(ownerAddress, _ERC721_PROXY_ADDRESS)`
bytes memory isApprovedForAllData = abi.encodeWithSelector(
_ERC721_IS_APPROVED_FOR_ALL_SELECTOR,
ownerAddress,
_ERC721_PROXY_ADDRESS
);
(bool success, bytes memory returnData) = tokenAddress.staticcall(isApprovedForAllData);
// If not approved for all, call `getApproved(tokenId)`
if (!success || returnData.length != 32 || returnData.readUint256(0) != 1) {
// Encode data for `getApproved(tokenId)`
bytes memory getApprovedData = abi.encodeWithSelector(_ERC721_GET_APPROVED_SELECTOR, tokenId);
(success, returnData) = tokenAddress.staticcall(getApprovedData);
// Allowance is 1 if successful and the approved address is the ERC721Proxy
allowance = success && returnData.length == 32 && returnData.readAddress(12) == _ERC721_PROXY_ADDRESS ? 1 : 0;
} else {
// Allowance is 2^256 - 1 if `isApprovedForAll` returned true
allowance = _MAX_UINT256;
}
} else if (assetProxyId == ERC1155_PROXY_ID) {
// Get ERC1155 token address
(, address tokenAddress, , , ) = decodeERC1155AssetData(assetData);
// Encode data for `isApprovedForAll(ownerAddress, _ERC1155_PROXY_ADDRESS)`
bytes memory isApprovedForAllData = abi.encodeWithSelector(
_ERC1155_IS_APPROVED_FOR_ALL_SELECTOR,
ownerAddress,
_ERC1155_PROXY_ADDRESS
);
// Query allowance
(bool success, bytes memory returnData) = tokenAddress.staticcall(isApprovedForAllData);
allowance = success && returnData.length == 32 && returnData.readUint256(0) == 1 ? _MAX_UINT256 : 0;
} else if (assetProxyId == STATIC_CALL_PROXY_ID) {
// The StaticCallProxy does not require any approvals
allowance = _MAX_UINT256;
}
// Allowance will be 0 if the assetProxyId is unknown
return allowance;
}
/// @dev Calls getAssetProxyAllowance() for each element of assetData.
/// @param ownerAddress Owner of the assets specified by assetData.
/// @param assetData Array of asset details, each encoded per the AssetProxy contract specification.
/// @return An array of asset allowances from getAllowance(), with each
/// element corresponding to the same-indexed element in the assetData input.
function getBatchAssetProxyAllowances(address ownerAddress, bytes[] memory assetData)
public
view
returns (uint256[] memory allowances)
{
uint256 length = assetData.length;
allowances = new uint256[](length);
for (uint256 i = 0; i != length; i++) {
allowances[i] = getAssetProxyAllowance(ownerAddress, assetData[i]);
}
return allowances;
}
/// @dev Calls getBalance() and getAllowance() for assetData.
/// @param ownerAddress Owner of the assets specified by assetData.
/// @param assetData Details of asset, encoded per the AssetProxy contract specification.
/// @return Number of assets (or asset baskets) held by owner, and number
/// of assets (or asset baskets) that the corresponding AssetProxy is authorized to spend.
function getBalanceAndAssetProxyAllowance(address ownerAddress, bytes memory assetData)
public
view
returns (uint256 balance, uint256 allowance)
{
balance = getBalance(ownerAddress, assetData);
allowance = getAssetProxyAllowance(ownerAddress, assetData);
return (balance, allowance);
}
/// @dev Calls getBatchBalances() and getBatchAllowances() for each element of assetData.
/// @param ownerAddress Owner of the assets specified by assetData.
/// @param assetData Array of asset details, each encoded per the AssetProxy contract specification.
/// @return An array of asset balances from getBalance(), and an array of
/// asset allowances from getAllowance(), with each element
/// corresponding to the same-indexed element in the assetData input.
function getBatchBalancesAndAssetProxyAllowances(address ownerAddress, bytes[] memory assetData)
public
view
returns (uint256[] memory balances, uint256[] memory allowances)
{
balances = getBatchBalances(ownerAddress, assetData);
allowances = getBatchAssetProxyAllowances(ownerAddress, assetData);
return (balances, allowances);
}
/// @dev Encode ERC-20 asset data into the format described in the AssetProxy contract specification.
/// @param tokenAddress The address of the ERC-20 contract hosting the asset to be traded.
/// @return AssetProxy-compliant data describing the asset.
function encodeERC20AssetData(address tokenAddress)
public
pure
returns (bytes memory assetData)
{
assetData = abi.encodeWithSelector(ERC20_PROXY_ID, tokenAddress);
return assetData;
}
/// @dev Decode ERC-20 asset data from the format described in the AssetProxy contract specification.
/// @param assetData AssetProxy-compliant asset data describing an ERC-20 asset.
/// @return The ERC-20 AssetProxy identifier, and the address of the ERC-20
/// contract hosting this asset.
function decodeERC20AssetData(bytes memory assetData)
public
pure
returns (
bytes4 assetProxyId,
address tokenAddress
)
{
assetProxyId = assetData.readBytes4(0);
require(
assetProxyId == ERC20_PROXY_ID,
"WRONG_PROXY_ID"
);
tokenAddress = assetData.readAddress(16);
return (assetProxyId, tokenAddress);
}
/// @dev Encode ERC-721 asset data into the format described in the AssetProxy specification.
/// @param tokenAddress The address of the ERC-721 contract hosting the asset to be traded.
/// @param tokenId The identifier of the specific asset to be traded.
/// @return AssetProxy-compliant asset data describing the asset.
function encodeERC721AssetData(address tokenAddress, uint256 tokenId)
public
pure
returns (bytes memory assetData)
{
assetData = abi.encodeWithSelector(
ERC721_PROXY_ID,
tokenAddress,
tokenId
);
return assetData;
}
/// @dev Decode ERC-721 asset data from the format described in the AssetProxy contract specification.
/// @param assetData AssetProxy-compliant asset data describing an ERC-721 asset.
/// @return The ERC-721 AssetProxy identifier, the address of the ERC-721
/// contract hosting this asset, and the identifier of the specific
/// asset to be traded.
function decodeERC721AssetData(bytes memory assetData)
public
pure
returns (
bytes4 assetProxyId,
address tokenAddress,
uint256 tokenId
)
{
assetProxyId = assetData.readBytes4(0);
require(
assetProxyId == ERC721_PROXY_ID,
"WRONG_PROXY_ID"
);
tokenAddress = assetData.readAddress(16);
tokenId = assetData.readUint256(36);
return (assetProxyId, tokenAddress, tokenId);
}
/// @dev Encode ERC-1155 asset data into the format described in the AssetProxy contract specification.
/// @param tokenAddress The address of the ERC-1155 contract hosting the asset(s) to be traded.
/// @param tokenIds The identifiers of the specific assets to be traded.
/// @param tokenValues The amounts of each asset to be traded.
/// @param callbackData Data to be passed to receiving contracts when a transfer is performed.
/// @return AssetProxy-compliant asset data describing the set of assets.
function encodeERC1155AssetData(
address tokenAddress,
uint256[] memory tokenIds,
uint256[] memory tokenValues,
bytes memory callbackData
)
public
pure
returns (bytes memory assetData)
{
assetData = abi.encodeWithSelector(
ERC1155_PROXY_ID,
tokenAddress,
tokenIds,
tokenValues,
callbackData
);
return assetData;
}
/// @dev Decode ERC-1155 asset data from the format described in the AssetProxy contract specification.
/// @param assetData AssetProxy-compliant asset data describing an ERC-1155 set of assets.
/// @return The ERC-1155 AssetProxy identifier, the address of the ERC-1155
/// contract hosting the assets, an array of the identifiers of the
/// assets to be traded, an array of asset amounts to be traded, and
/// callback data. Each element of the arrays corresponds to the
/// same-indexed element of the other array. Return values specified as
/// `memory` are returned as pointers to locations within the memory of
/// the input parameter `assetData`.
function decodeERC1155AssetData(bytes memory assetData)
public
pure
returns (
bytes4 assetProxyId,
address tokenAddress,
uint256[] memory tokenIds,
uint256[] memory tokenValues,
bytes memory callbackData
)
{
assetProxyId = assetData.readBytes4(0);
require(
assetProxyId == ERC1155_PROXY_ID,
"WRONG_PROXY_ID"
);
assembly {
// Skip selector and length to get to the first parameter:
assetData := add(assetData, 36)
// Read the value of the first parameter:
tokenAddress := mload(assetData)
// Point to the next parameter's data:
tokenIds := add(assetData, mload(add(assetData, 32)))
// Point to the next parameter's data:
tokenValues := add(assetData, mload(add(assetData, 64)))
// Point to the next parameter's data:
callbackData := add(assetData, mload(add(assetData, 96)))
}
return (
assetProxyId,
tokenAddress,
tokenIds,
tokenValues,
callbackData
);
}
/// @dev Encode data for multiple assets, per the AssetProxy contract specification.
/// @param amounts The amounts of each asset to be traded.
/// @param nestedAssetData AssetProxy-compliant data describing each asset to be traded.
/// @return AssetProxy-compliant data describing the set of assets.
function encodeMultiAssetData(uint256[] memory amounts, bytes[] memory nestedAssetData)
public
pure
returns (bytes memory assetData)
{
assetData = abi.encodeWithSelector(
MULTI_ASSET_PROXY_ID,
amounts,
nestedAssetData
);
return assetData;
}
/// @dev Decode multi-asset data from the format described in the AssetProxy contract specification.
/// @param assetData AssetProxy-compliant data describing a multi-asset basket.
/// @return The Multi-Asset AssetProxy identifier, an array of the amounts
/// of the assets to be traded, and an array of the
/// AssetProxy-compliant data describing each asset to be traded. Each
/// element of the arrays corresponds to the same-indexed element of the other array.
function decodeMultiAssetData(bytes memory assetData)
public
pure
returns (
bytes4 assetProxyId,
uint256[] memory amounts,
bytes[] memory nestedAssetData
)
{
assetProxyId = assetData.readBytes4(0);
require(
assetProxyId == MULTI_ASSET_PROXY_ID,
"WRONG_PROXY_ID"
);
// solhint-disable indent
(amounts, nestedAssetData) = abi.decode(
assetData.slice(4, assetData.length),
(uint256[], bytes[])
);
// solhint-enable indent
}
/// @dev Calls `asset.ownerOf(tokenId)`, but returns a null owner instead of reverting on an unowned asset.
/// @param tokenAddress Address of ERC721 asset.
/// @param tokenId The identifier for the specific NFT.
/// @return Owner of tokenId or null address if unowned.
function getERC721TokenOwner(address tokenAddress, uint256 tokenId)
public
view
returns (address ownerAddress)
{
bytes memory ownerOfCalldata = abi.encodeWithSelector(
_ERC721_OWNER_OF_SELECTOR,
tokenId
);
(bool success, bytes memory returnData) = tokenAddress.staticcall(ownerOfCalldata);
ownerAddress = (success && returnData.length == 32) ? returnData.readAddress(12) : address(0);
return ownerAddress;
}
}

View File

@@ -0,0 +1,193 @@
/*
Copyright 2019 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;
pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibExchangeSelectors.sol";
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
contract LibTransactionDecoder is
LibExchangeSelectors
{
using LibBytes for bytes;
/// @dev Decodes the call data for an Exchange contract method call.
/// @param transactionData ABI-encoded calldata for an Exchange
/// contract method call.
/// @return The name of the function called, and the parameters it was
/// given. For single-order fills and cancels, the arrays will have
/// just one element.
function decodeZeroExTransactionData(bytes memory transactionData)
public
pure
returns(
string memory functionName,
LibOrder.Order[] memory orders,
uint256[] memory takerAssetFillAmounts,
bytes[] memory signatures
)
{
bytes4 functionSelector = transactionData.readBytes4(0);
if (functionSelector == BATCH_CANCEL_ORDERS_SELECTOR) {
functionName = "batchCancelOrders";
} else if (functionSelector == BATCH_FILL_ORDERS_SELECTOR) {
functionName = "batchFillOrders";
} else if (functionSelector == BATCH_FILL_ORDERS_NO_THROW_SELECTOR) {
functionName = "batchFillOrdersNoThrow";
} else if (functionSelector == BATCH_FILL_OR_KILL_ORDERS_SELECTOR) {
functionName = "batchFillOrKillOrders";
} else if (functionSelector == CANCEL_ORDER_SELECTOR) {
functionName = "cancelOrder";
} else if (functionSelector == FILL_ORDER_SELECTOR) {
functionName = "fillOrder";
} else if (functionSelector == FILL_ORDER_NO_THROW_SELECTOR) {
functionName = "fillOrderNoThrow";
} else if (functionSelector == FILL_OR_KILL_ORDER_SELECTOR) {
functionName = "fillOrKillOrder";
} else if (functionSelector == MARKET_BUY_ORDERS_SELECTOR) {
functionName = "marketBuyOrders";
} else if (functionSelector == MARKET_BUY_ORDERS_NO_THROW_SELECTOR) {
functionName = "marketBuyOrdersNoThrow";
} else if (functionSelector == MARKET_SELL_ORDERS_SELECTOR) {
functionName = "marketSellOrders";
} else if (functionSelector == MARKET_SELL_ORDERS_NO_THROW_SELECTOR) {
functionName = "marketSellOrdersNoThrow";
} else if (functionSelector == MATCH_ORDERS_SELECTOR) {
functionName = "matchOrders";
} else if (
functionSelector == CANCEL_ORDERS_UP_TO_SELECTOR ||
functionSelector == EXECUTE_TRANSACTION_SELECTOR
// TODO: add new noThrow cancel functions when https://github.com/0xProject/ZEIPs/issues/35 is merged.
) {
revert("UNIMPLEMENTED");
} else {
revert("UNKNOWN_FUNCTION_SELECTOR");
}
if (functionSelector == BATCH_CANCEL_ORDERS_SELECTOR) {
// solhint-disable-next-line indent
orders = abi.decode(transactionData.slice(4, transactionData.length), (LibOrder.Order[]));
takerAssetFillAmounts = new uint256[](0);
signatures = new bytes[](0);
} else if (
functionSelector == BATCH_FILL_OR_KILL_ORDERS_SELECTOR ||
functionSelector == BATCH_FILL_ORDERS_NO_THROW_SELECTOR ||
functionSelector == BATCH_FILL_ORDERS_SELECTOR
) {
(orders, takerAssetFillAmounts, signatures) = _makeReturnValuesForBatchFill(transactionData);
} else if (functionSelector == CANCEL_ORDER_SELECTOR) {
orders = new LibOrder.Order[](1);
orders[0] = abi.decode(transactionData.slice(4, transactionData.length), (LibOrder.Order));
takerAssetFillAmounts = new uint256[](0);
signatures = new bytes[](0);
} else if (
functionSelector == FILL_OR_KILL_ORDER_SELECTOR ||
functionSelector == FILL_ORDER_SELECTOR ||
functionSelector == FILL_ORDER_NO_THROW_SELECTOR
) {
(orders, takerAssetFillAmounts, signatures) = _makeReturnValuesForSingleOrderFill(transactionData);
} else if (
functionSelector == MARKET_BUY_ORDERS_SELECTOR ||
functionSelector == MARKET_BUY_ORDERS_NO_THROW_SELECTOR ||
functionSelector == MARKET_SELL_ORDERS_SELECTOR ||
functionSelector == MARKET_SELL_ORDERS_NO_THROW_SELECTOR
) {
(orders, takerAssetFillAmounts, signatures) = _makeReturnValuesForMarketFill(transactionData);
} else if (functionSelector == MATCH_ORDERS_SELECTOR) {
(
LibOrder.Order memory leftOrder,
LibOrder.Order memory rightOrder,
bytes memory leftSignature,
bytes memory rightSignature
) = abi.decode(
transactionData.slice(4, transactionData.length),
(LibOrder.Order, LibOrder.Order, bytes, bytes)
);
orders = new LibOrder.Order[](2);
orders[0] = leftOrder;
orders[1] = rightOrder;
takerAssetFillAmounts = new uint256[](2);
takerAssetFillAmounts[0] = leftOrder.takerAssetAmount;
takerAssetFillAmounts[1] = rightOrder.takerAssetAmount;
signatures = new bytes[](2);
signatures[0] = leftSignature;
signatures[1] = rightSignature;
}
}
function _makeReturnValuesForSingleOrderFill(bytes memory transactionData)
private
pure
returns(
LibOrder.Order[] memory orders,
uint256[] memory takerAssetFillAmounts,
bytes[] memory signatures
)
{
orders = new LibOrder.Order[](1);
takerAssetFillAmounts = new uint256[](1);
signatures = new bytes[](1);
// solhint-disable-next-line indent
(orders[0], takerAssetFillAmounts[0], signatures[0]) = abi.decode(
transactionData.slice(4, transactionData.length),
(LibOrder.Order, uint256, bytes)
);
}
function _makeReturnValuesForBatchFill(bytes memory transactionData)
private
pure
returns(
LibOrder.Order[] memory orders,
uint256[] memory takerAssetFillAmounts,
bytes[] memory signatures
)
{
// solhint-disable-next-line indent
(orders, takerAssetFillAmounts, signatures) = abi.decode(
transactionData.slice(4, transactionData.length),
// solhint-disable-next-line indent
(LibOrder.Order[], uint256[], bytes[])
);
}
function _makeReturnValuesForMarketFill(bytes memory transactionData)
private
pure
returns(
LibOrder.Order[] memory orders,
uint256[] memory takerAssetFillAmounts,
bytes[] memory signatures
)
{
takerAssetFillAmounts = new uint256[](1);
// solhint-disable-next-line indent
(orders, takerAssetFillAmounts[0], signatures) = abi.decode(
transactionData.slice(4, transactionData.length),
// solhint-disable-next-line indent
(LibOrder.Order[], uint256, bytes[])
);
}
}

View File

@@ -0,0 +1,184 @@
/*
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;
pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange/contracts/src/interfaces/IExchange.sol";
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
import "@0x/contracts-exchange-libs/contracts/src/LibMath.sol";
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
import "./LibAssetData.sol";
contract OrderValidationUtils is
LibAssetData,
LibMath
{
using LibBytes for bytes;
// solhint-disable var-name-mixedcase
bytes internal _ZRX_ASSET_DATA;
// solhint-enable var-name-mixedcase
constructor (address _exchange, bytes memory _zrxAssetData)
public
LibAssetData(_exchange)
{
_ZRX_ASSET_DATA = _zrxAssetData;
}
/// @dev Fetches all order-relevant information needed to validate if the supplied order is fillable.
/// @param order The order structure.
/// @param signature Signature provided by maker that proves the order's authenticity.
/// `0x01` can always be provided if the signature does not need to be validated.
/// @return The orderInfo (hash, status, and `takerAssetAmount` already filled for the given order),
/// fillableTakerAssetAmount (amount of the order's `takerAssetAmount` that is fillable given all on-chain state),
/// and isValidSignature (validity of the provided signature).
/// NOTE: If the `takerAssetData` encodes data for multiple assets, `fillableTakerAssetAmount` will represent a "scaled"
/// amount, meaning it must be multiplied by all the individual asset amounts within the `takerAssetData` to get the final
/// amount of each asset that can be filled.
function getOrderRelevantState(LibOrder.Order memory order, bytes memory signature)
public
view
returns (
LibOrder.OrderInfo memory orderInfo,
uint256 fillableTakerAssetAmount,
bool isValidSignature
)
{
// Get info specific to order
orderInfo = _EXCHANGE.getOrderInfo(order);
// Validate the maker's signature
address makerAddress = order.makerAddress;
isValidSignature = _EXCHANGE.isValidSignature(
orderInfo.orderHash,
makerAddress,
signature
);
// Get the transferable amount of the `makerAsset`
uint256 transferableMakerAssetAmount = getTransferableAssetAmount(makerAddress, order.makerAssetData);
// Assign to stack variables to reduce redundant mloads/sloads
uint256 takerAssetAmount = order.takerAssetAmount;
uint256 makerFee = order.makerFee;
bytes memory zrxAssetData = _ZRX_ASSET_DATA;
// Get the amount of `takerAsset` that is transferable to maker given the transferability of `makerAsset`, `makerFeeAsset`,
// and the total amounts specified in the order
uint256 transferableTakerAssetAmount;
if (order.makerAssetData.equals(zrxAssetData)) {
// If `makerAsset` equals `makerFeeAsset`, the % that can be filled is
// transferableMakerAssetAmount / (makerAssetAmount + makerFee)
transferableTakerAssetAmount = getPartialAmountFloor(
transferableMakerAssetAmount,
safeAdd(order.makerAssetAmount, makerFee),
takerAssetAmount
);
} else {
// Get the transferable amount of the `makerFeeAsset`
uint256 transferableMakerFeeAssetAmount = getTransferableAssetAmount(makerAddress, zrxAssetData);
// If `makerFee` is 0, the % that can be filled is (transferableMakerAssetAmount / makerAssetAmount)
if (makerFee == 0) {
transferableTakerAssetAmount = getPartialAmountFloor(
transferableMakerAssetAmount,
order.makerAssetAmount,
takerAssetAmount
);
// If `makerAsset` does not equal `makerFeeAsset`, the % that can be filled is the lower of
// (transferableMakerAssetAmount / makerAssetAmount) and (transferableMakerAssetFeeAmount / makerFee)
} else {
uint256 transferableMakerToTakerAmount = getPartialAmountFloor(
transferableMakerAssetAmount,
order.makerAssetAmount,
takerAssetAmount
);
uint256 transferableMakerFeeToTakerAmount = getPartialAmountFloor(
transferableMakerFeeAssetAmount,
makerFee,
takerAssetAmount
);
transferableTakerAssetAmount = min256(transferableMakerToTakerAmount, transferableMakerFeeToTakerAmount);
}
}
// `fillableTakerAssetAmount` is the lower of the order's remaining `takerAssetAmount` and the `transferableTakerAssetAmount`
fillableTakerAssetAmount = min256(
safeSub(takerAssetAmount, orderInfo.orderTakerAssetFilledAmount),
transferableTakerAssetAmount
);
return (orderInfo, fillableTakerAssetAmount, isValidSignature);
}
/// @dev Fetches all order-relevant information needed to validate if the supplied orders are fillable.
/// @param orders Array of order structures.
/// @param signatures Array of signatures provided by makers that prove the authenticity of the orders.
/// `0x01` can always be provided if a signature does not need to be validated.
/// @return The ordersInfo (array of the hash, status, and `takerAssetAmount` already filled for each order),
/// fillableTakerAssetAmounts (array of amounts for each order's `takerAssetAmount` that is fillable given all on-chain state),
/// and isValidSignature (array containing the validity of each provided signature).
/// NOTE: If the `takerAssetData` encodes data for multiple assets, each element of `fillableTakerAssetAmounts`
/// will represent a "scaled" amount, meaning it must be multiplied by all the individual asset amounts within
/// the `takerAssetData` to get the final amount of each asset that can be filled.
function getOrderRelevantStates(LibOrder.Order[] memory orders, bytes[] memory signatures)
public
view
returns (
LibOrder.OrderInfo[] memory ordersInfo,
uint256[] memory fillableTakerAssetAmounts,
bool[] memory isValidSignature
)
{
uint256 length = orders.length;
ordersInfo = new LibOrder.OrderInfo[](length);
fillableTakerAssetAmounts = new uint256[](length);
isValidSignature = new bool[](length);
for (uint256 i = 0; i != length; i++) {
(ordersInfo[i], fillableTakerAssetAmounts[i], isValidSignature[i]) = getOrderRelevantState(
orders[i],
signatures[i]
);
}
return (ordersInfo, fillableTakerAssetAmounts, isValidSignature);
}
/// @dev Gets the amount of an asset transferable by the owner.
/// @param ownerAddress Address of the owner of the asset.
/// @param assetData Description of tokens, per the AssetProxy contract specification.
/// @return The amount of the asset tranferable by the owner.
/// NOTE: If the `assetData` encodes data for multiple assets, the `transferableAssetAmount`
/// will represent the amount of times the entire `assetData` can be transferred. To calculate
/// the total individual transferable amounts, this scaled `transferableAmount` must be multiplied by
/// the individual asset amounts located within the `assetData`.
function getTransferableAssetAmount(address ownerAddress, bytes memory assetData)
public
view
returns (uint256 transferableAssetAmount)
{
(uint256 balance, uint256 allowance) = getBalanceAndAssetProxyAllowance(ownerAddress, assetData);
transferableAssetAmount = min256(balance, allowance);
return transferableAssetAmount;
}
}

View File

@@ -0,0 +1,91 @@
{
"name": "@0x/contracts-dev-utils",
"version": "0.0.9",
"engines": {
"node": ">=6.12"
},
"description": "0x protocol specific utility contracts",
"main": "lib/src/index.js",
"directories": {
"test": "test"
},
"scripts": {
"build": "yarn pre_build && tsc -b",
"build:ci": "yarn build",
"pre_build": "run-s compile generate_contract_wrappers",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s build test",
"test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov",
"test:profiler": "SOLIDITY_PROFILER=true run-s build run_mocha profiler:report:html",
"test:trace": "SOLIDITY_REVERT_TRACE=true run-s build run_mocha",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe 'lib/test/**/*.js' --timeout 100000 --bail --exit",
"compile": "sol-compiler",
"watch": "sol-compiler -w",
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
"coverage:report:text": "istanbul report text",
"coverage:report:html": "istanbul report html && open coverage/index.html",
"profiler:report:html": "istanbul report html && open coverage/index.html",
"coverage:report:lcov": "istanbul report lcov",
"test:circleci": "yarn test",
"contracts:gen": "contracts-gen",
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
},
"config": {
"abis": "./generated-artifacts/@(DevUtils|LibAssetData|LibTransactionDecoder|EthBalanceChecker).json",
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
},
"repository": {
"type": "git",
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/0xProject/0x-monorepo/issues"
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/dev-utils/README.md",
"devDependencies": {
"@0x/abi-gen": "^4.2.0",
"@0x/contracts-gen": "^1.0.14",
"@0x/contracts-test-utils": "^3.1.15",
"@0x/dev-utils": "^2.3.2",
"@0x/sol-compiler": "^3.1.14",
"@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": "^6.2.0",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"solhint": "^1.4.1",
"tslint": "5.11.0",
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.3",
"@0x/contracts-asset-proxy": "^2.2.7",
"@0x/contracts-erc1155": "^1.1.14",
"@0x/contracts-erc20": "^2.2.13",
"@0x/contracts-erc721": "^2.1.14",
"@0x/contracts-exchange": "^2.1.13",
"@0x/contracts-exchange-libs": "^3.0.7",
"@0x/contracts-utils": "^3.2.3",
"@0x/order-utils": "^8.3.1",
"@0x/types": "^2.4.2",
"@0x/typescript-typings": "^4.2.5",
"@0x/utils": "^4.5.1",
"@0x/web3-wrapper": "^6.0.12",
"ethereum-types": "^2.1.5",
"ethereumjs-util": "^5.1.1"
},
"publishConfig": {
"access": "public"
}
}

View File

@@ -0,0 +1,15 @@
/*
* -----------------------------------------------------------------------------
* Warning: This file is auto-generated by contracts-gen. Don't edit manually.
* -----------------------------------------------------------------------------
*/
import { ContractArtifact } from 'ethereum-types';
import * as DevUtils from '../generated-artifacts/DevUtils.json';
import * as LibAssetData from '../generated-artifacts/LibAssetData.json';
import * as LibTransactionDecoder from '../generated-artifacts/LibTransactionDecoder.json';
export const artifacts = {
DevUtils: DevUtils as ContractArtifact,
LibTransactionDecoder: LibTransactionDecoder as ContractArtifact,
LibAssetData: LibAssetData as ContractArtifact,
};

View File

@@ -0,0 +1,2 @@
export * from './artifacts';
export * from './wrappers';

View File

@@ -0,0 +1,8 @@
/*
* -----------------------------------------------------------------------------
* Warning: This file is auto-generated by contracts-gen. Don't edit manually.
* -----------------------------------------------------------------------------
*/
export * from '../generated-wrappers/dev_utils';
export * from '../generated-wrappers/lib_asset_data';
export * from '../generated-wrappers/lib_transaction_decoder';

View File

@@ -0,0 +1,19 @@
import { env, EnvVars } from '@0x/dev-utils';
import { coverage, profiler, provider } from '@0x/contracts-test-utils';
import { providerUtils } from '@0x/utils';
before('start web3 provider', () => {
providerUtils.startProviderEngine(provider);
});
after('generate coverage report', async () => {
if (env.parseBoolean(EnvVars.SolidityCoverage)) {
const coverageSubprovider = coverage.getCoverageSubproviderSingleton();
await coverageSubprovider.writeCoverageAsync();
}
if (env.parseBoolean(EnvVars.SolidityProfiler)) {
const profilerSubprovider = profiler.getProfilerSubproviderSingleton();
await profilerSubprovider.writeProfilerOutputAsync();
}
provider.stop();
});

View File

@@ -0,0 +1,538 @@
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import {
artifacts as proxyArtifacts,
ERC1155ProxyContract,
ERC20ProxyContract,
ERC721ProxyContract,
MultiAssetProxyContract,
StaticCallProxyContract,
TestStaticCallTargetContract,
} from '@0x/contracts-asset-proxy';
import {
artifacts as erc1155Artifacts,
ERC1155MintableContract,
ERC1155TransferSingleEventArgs,
} from '@0x/contracts-erc1155';
import { artifacts as erc20Artifacts, DummyERC20TokenContract } from '@0x/contracts-erc20';
import { artifacts as erc721Artifacts, DummyERC721TokenContract } from '@0x/contracts-erc721';
import { artifacts as exchangeArtifacts, ExchangeContract } from '@0x/contracts-exchange';
import { chaiSetup, constants, LogDecoder, provider, txDefaults, web3Wrapper } from '@0x/contracts-test-utils';
import { BlockchainLifecycle } from '@0x/dev-utils';
import { assetDataUtils } from '@0x/order-utils';
import { AssetProxyId } from '@0x/types';
import { BigNumber } from '@0x/utils';
import * as ethUtil from 'ethereumjs-util';
import { artifacts, LibAssetDataContract } from '../src';
chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
const KNOWN_ERC20_ENCODING = {
address: '0x1dc4c1cefef38a777b15aa20260a54e584b16c48',
assetData: '0xf47261b00000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48',
};
const KNOWN_ERC721_ENCODING = {
address: '0x1dc4c1cefef38a777b15aa20260a54e584b16c48',
tokenId: new BigNumber(1),
assetData:
'0x025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000001',
};
const KNOWN_ERC1155_ENCODING = {
tokenAddress: '0x1dc4c1cefef38a777b15aa20260a54e584b16c48',
tokenIds: [new BigNumber(100), new BigNumber(1001), new BigNumber(10001)],
tokenValues: [new BigNumber(200), new BigNumber(2001), new BigNumber(20001)],
callbackData:
'0x025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000001',
assetData:
'0xa7cb5fb70000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000003e90000000000000000000000000000000000000000000000000000000000002711000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000007d10000000000000000000000000000000000000000000000000000000000004e210000000000000000000000000000000000000000000000000000000000000044025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000',
};
const KNOWN_MULTI_ASSET_ENCODING = {
amounts: [new BigNumber(70), new BigNumber(1), new BigNumber(18)],
nestedAssetData: [
KNOWN_ERC20_ENCODING.assetData,
KNOWN_ERC721_ENCODING.assetData,
KNOWN_ERC1155_ENCODING.assetData,
],
assetData:
'0x94cfcdd7000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000024f47261b00000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000204a7cb5fb70000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000003e90000000000000000000000000000000000000000000000000000000000002711000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000007d10000000000000000000000000000000000000000000000000000000000004e210000000000000000000000000000000000000000000000000000000000000044025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c4800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
};
describe('LibAssetData', () => {
let exchange: ExchangeContract;
let erc20Proxy: ERC20ProxyContract;
let erc721Proxy: ERC721ProxyContract;
let erc1155Proxy: ERC1155ProxyContract;
let multiAssetProxy: MultiAssetProxyContract;
let staticCallProxy: StaticCallProxyContract;
let staticCallTarget: TestStaticCallTargetContract;
let libAssetData: LibAssetDataContract;
let tokenOwnerAddress: string;
let erc20Token: DummyERC20TokenContract;
let erc721Token: DummyERC721TokenContract;
let erc1155Token: ERC1155MintableContract;
const erc20TokenTotalSupply = new BigNumber(1);
const firstERC721TokenId = new BigNumber(1);
const numberOfERC721Tokens = 10;
let erc1155TokenId: BigNumber;
before(async () => {
await blockchainLifecycle.startAsync();
exchange = await ExchangeContract.deployFrom0xArtifactAsync(
exchangeArtifacts.Exchange,
provider,
txDefaults,
artifacts,
constants.NULL_BYTES,
);
erc20Proxy = await ERC20ProxyContract.deployFrom0xArtifactAsync(
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);
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(erc721Proxy.address);
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(erc1155Proxy.address);
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(multiAssetProxy.address);
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(staticCallProxy.address);
libAssetData = await LibAssetDataContract.deployFrom0xArtifactAsync(
artifacts.LibAssetData,
provider,
txDefaults,
artifacts,
exchange.address,
);
staticCallTarget = await TestStaticCallTargetContract.deployFrom0xArtifactAsync(
proxyArtifacts.TestStaticCallTarget,
provider,
txDefaults,
artifacts,
);
[tokenOwnerAddress] = await web3Wrapper.getAvailableAddressesAsync();
erc20Token = await DummyERC20TokenContract.deployFrom0xArtifactAsync(
erc20Artifacts.DummyERC20Token,
provider,
txDefaults,
artifacts,
'Dummy',
'DUM',
new BigNumber(1),
erc20TokenTotalSupply,
);
erc721Token = await DummyERC721TokenContract.deployFrom0xArtifactAsync(
erc721Artifacts.DummyERC721Token,
provider,
txDefaults,
artifacts,
'Dummy',
'DUM',
);
// mint `numberOfERC721Tokens` tokens
const transactionMinedPromises = [];
for (let i = 0; i < numberOfERC721Tokens; i++) {
transactionMinedPromises.push(
erc721Token.mint.awaitTransactionSuccessAsync(tokenOwnerAddress, firstERC721TokenId.plus(i - 1)),
);
}
await Promise.all(transactionMinedPromises);
erc1155Token = await ERC1155MintableContract.deployFrom0xArtifactAsync(
erc1155Artifacts.ERC1155Mintable,
provider,
txDefaults,
artifacts,
);
const logDecoder = new LogDecoder(web3Wrapper, erc1155Artifacts);
const transactionReceipt = await logDecoder.getTxWithDecodedLogsAsync(
await erc1155Token.create.sendTransactionAsync('uri:Dummy', /*isNonFungible:*/ false),
);
// tslint:disable-next-line no-unnecessary-type-assertion
erc1155TokenId = (transactionReceipt.logs[0] as LogWithDecodedArgs<ERC1155TransferSingleEventArgs>).args.id;
await erc1155Token.mintFungible.awaitTransactionSuccessAsync(
erc1155TokenId,
[tokenOwnerAddress],
[new BigNumber(1)],
);
});
after(async () => {
await blockchainLifecycle.revertAsync();
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();
});
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
it('should have a deployed-to address', () => {
expect(libAssetData.address.slice(0, 2)).to.equal('0x');
});
describe('encoding and decoding', () => {
it('should encode ERC20 asset data', async () => {
expect(await libAssetData.encodeERC20AssetData.callAsync(KNOWN_ERC20_ENCODING.address)).to.equal(
KNOWN_ERC20_ENCODING.assetData,
);
});
it('should decode ERC20 asset data', async () => {
expect(await libAssetData.decodeERC20AssetData.callAsync(KNOWN_ERC20_ENCODING.assetData)).to.deep.equal([
AssetProxyId.ERC20,
KNOWN_ERC20_ENCODING.address,
]);
});
it('should encode ERC721 asset data', async () => {
expect(
await libAssetData.encodeERC721AssetData.callAsync(
KNOWN_ERC721_ENCODING.address,
KNOWN_ERC721_ENCODING.tokenId,
),
).to.equal(KNOWN_ERC721_ENCODING.assetData);
});
it('should decode ERC721 asset data', async () => {
expect(await libAssetData.decodeERC721AssetData.callAsync(KNOWN_ERC721_ENCODING.assetData)).to.deep.equal([
AssetProxyId.ERC721,
KNOWN_ERC721_ENCODING.address,
KNOWN_ERC721_ENCODING.tokenId,
]);
});
it('should encode ERC1155 asset data', async () => {
expect(
await libAssetData.encodeERC1155AssetData.callAsync(
KNOWN_ERC1155_ENCODING.tokenAddress,
KNOWN_ERC1155_ENCODING.tokenIds,
KNOWN_ERC1155_ENCODING.tokenValues,
KNOWN_ERC1155_ENCODING.callbackData,
),
).to.equal(KNOWN_ERC1155_ENCODING.assetData);
});
it('should decode ERC1155 asset data', async () => {
expect(await libAssetData.decodeERC1155AssetData.callAsync(KNOWN_ERC1155_ENCODING.assetData)).to.deep.equal(
[
AssetProxyId.ERC1155,
KNOWN_ERC1155_ENCODING.tokenAddress,
KNOWN_ERC1155_ENCODING.tokenIds,
KNOWN_ERC1155_ENCODING.tokenValues,
KNOWN_ERC1155_ENCODING.callbackData,
],
);
});
it('should encode multiasset data', async () => {
expect(
await libAssetData.encodeMultiAssetData.callAsync(
KNOWN_MULTI_ASSET_ENCODING.amounts,
KNOWN_MULTI_ASSET_ENCODING.nestedAssetData,
),
).to.equal(KNOWN_MULTI_ASSET_ENCODING.assetData);
});
it('should decode multiasset data', async () => {
expect(
await libAssetData.decodeMultiAssetData.callAsync(KNOWN_MULTI_ASSET_ENCODING.assetData),
).to.deep.equal([
AssetProxyId.MultiAsset,
KNOWN_MULTI_ASSET_ENCODING.amounts,
KNOWN_MULTI_ASSET_ENCODING.nestedAssetData,
]);
});
});
describe('getBalance', () => {
it('should query ERC20 balance by asset data', async () => {
const assetData = assetDataUtils.encodeERC20AssetData(erc20Token.address);
expect(await libAssetData.getBalance.callAsync(tokenOwnerAddress, assetData)).to.bignumber.equal(
erc20TokenTotalSupply,
);
});
it('should return 0 if ERC20 token does not exist', async () => {
const assetData = assetDataUtils.encodeERC20AssetData(constants.NULL_ADDRESS);
const balance = await libAssetData.getBalance.callAsync(tokenOwnerAddress, assetData);
expect(balance).to.bignumber.equal(constants.ZERO_AMOUNT);
});
it('should query ERC721 balance by asset data', async () => {
const assetData = assetDataUtils.encodeERC721AssetData(erc721Token.address, firstERC721TokenId);
expect(await libAssetData.getBalance.callAsync(tokenOwnerAddress, assetData)).to.bignumber.equal(1);
});
it('should return 0 if ERC721 token does not exist', async () => {
const assetData = assetDataUtils.encodeERC721AssetData(constants.NULL_ADDRESS, firstERC721TokenId);
const balance = await libAssetData.getBalance.callAsync(tokenOwnerAddress, assetData);
expect(balance).to.bignumber.equal(constants.ZERO_AMOUNT);
});
it('should query ERC1155 balances by asset data', async () => {
const assetData = assetDataUtils.encodeERC1155AssetData(
erc1155Token.address,
[erc1155TokenId],
[new BigNumber(1)],
constants.NULL_BYTES,
);
expect(await libAssetData.getBalance.callAsync(tokenOwnerAddress, assetData)).to.bignumber.equal(1);
});
it('should return 0 if ERC1155 token does not exist', async () => {
const assetData = assetDataUtils.encodeERC1155AssetData(
constants.NULL_ADDRESS,
[erc1155TokenId],
[new BigNumber(1)],
constants.NULL_BYTES,
);
const balance = await libAssetData.getBalance.callAsync(tokenOwnerAddress, assetData);
expect(balance).to.bignumber.equal(constants.ZERO_AMOUNT);
});
it('should query multi-asset batch balance by asset data', async () => {
const assetData = assetDataUtils.encodeMultiAssetData(
[new BigNumber(1), new BigNumber(1)],
[
assetDataUtils.encodeERC20AssetData(erc20Token.address),
assetDataUtils.encodeERC721AssetData(erc721Token.address, firstERC721TokenId),
],
);
expect(await libAssetData.getBalance.callAsync(tokenOwnerAddress, assetData)).to.bignumber.equal(
Math.min(erc20TokenTotalSupply.toNumber(), numberOfERC721Tokens),
);
});
it('should return a balance of 0 if the assetData does not correspond to an AssetProxy contract', async () => {
const fakeAssetData = '0x01020304';
const balance = await libAssetData.getBalance.callAsync(tokenOwnerAddress, fakeAssetData);
expect(balance).to.bignumber.equal(constants.ZERO_AMOUNT);
});
it('should return a balance of MAX_UINT256 if the the StaticCallProxy assetData contains data for a successful staticcall', async () => {
const staticCallData = staticCallTarget.isOddNumber.getABIEncodedTransactionData(new BigNumber(1));
const trueAsBuffer = ethUtil.toBuffer('0x0000000000000000000000000000000000000000000000000000000000000001');
const expectedResultHash = ethUtil.bufferToHex(ethUtil.sha3(trueAsBuffer));
const assetData = assetDataUtils.encodeStaticCallAssetData(
staticCallTarget.address,
staticCallData,
expectedResultHash,
);
const balance = await libAssetData.getBalance.callAsync(tokenOwnerAddress, assetData);
expect(balance).to.bignumber.equal(constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS);
});
it('should return a balance of 0 if the the StaticCallProxy assetData contains data for an unsuccessful staticcall', async () => {
const staticCallData = staticCallTarget.isOddNumber.getABIEncodedTransactionData(new BigNumber(0));
const trueAsBuffer = ethUtil.toBuffer('0x0000000000000000000000000000000000000000000000000000000000000001');
const expectedResultHash = ethUtil.bufferToHex(ethUtil.sha3(trueAsBuffer));
const assetData = assetDataUtils.encodeStaticCallAssetData(
staticCallTarget.address,
staticCallData,
expectedResultHash,
);
const balance = await libAssetData.getBalance.callAsync(tokenOwnerAddress, assetData);
expect(balance).to.bignumber.equal(constants.ZERO_AMOUNT);
});
});
describe('getAssetProxyAllowance', () => {
it('should query ERC20 allowances by asset data', async () => {
const allowance = new BigNumber(1);
await erc20Token.approve.awaitTransactionSuccessAsync(erc20Proxy.address, allowance, {
from: tokenOwnerAddress,
});
const assetData = assetDataUtils.encodeERC20AssetData(erc20Token.address);
expect(
await libAssetData.getAssetProxyAllowance.callAsync(tokenOwnerAddress, assetData),
).to.bignumber.equal(allowance);
});
it('should query ERC721 approval by asset data', async () => {
await erc721Token.approve.awaitTransactionSuccessAsync(erc721Proxy.address, firstERC721TokenId, {
from: tokenOwnerAddress,
});
const assetData = assetDataUtils.encodeERC721AssetData(erc721Token.address, firstERC721TokenId);
expect(
await libAssetData.getAssetProxyAllowance.callAsync(tokenOwnerAddress, assetData),
).to.bignumber.equal(1);
});
it('should query ERC721 approvalForAll by assetData', async () => {
await erc721Token.setApprovalForAll.awaitTransactionSuccessAsync(erc721Proxy.address, true, {
from: tokenOwnerAddress,
});
const assetData = assetDataUtils.encodeERC721AssetData(erc721Token.address, firstERC721TokenId);
expect(
await libAssetData.getAssetProxyAllowance.callAsync(tokenOwnerAddress, assetData),
).to.bignumber.equal(constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS);
});
it('should query ERC1155 allowances by asset data', async () => {
await erc1155Token.setApprovalForAll.awaitTransactionSuccessAsync(erc1155Proxy.address, true, {
from: tokenOwnerAddress,
});
const assetData = assetDataUtils.encodeERC1155AssetData(
erc1155Token.address,
[erc1155TokenId],
[new BigNumber(1)],
constants.NULL_BYTES,
);
expect(
await libAssetData.getAssetProxyAllowance.callAsync(tokenOwnerAddress, assetData),
).to.bignumber.equal(constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS);
});
it('should query multi-asset allowances by asset data', async () => {
const allowance = new BigNumber(1);
await erc20Token.approve.awaitTransactionSuccessAsync(erc20Proxy.address, allowance, {
from: tokenOwnerAddress,
});
await erc721Token.approve.awaitTransactionSuccessAsync(erc721Proxy.address, firstERC721TokenId, {
from: tokenOwnerAddress,
});
const assetData = assetDataUtils.encodeMultiAssetData(
[new BigNumber(1), new BigNumber(1)],
[
assetDataUtils.encodeERC20AssetData(erc20Token.address),
assetDataUtils.encodeERC721AssetData(erc721Token.address, firstERC721TokenId),
],
);
expect(
await libAssetData.getAssetProxyAllowance.callAsync(tokenOwnerAddress, assetData),
).to.bignumber.equal(1);
return;
});
it('should return an allowance of 0 if the assetData does not correspond to an AssetProxy contract', async () => {
const fakeAssetData = '0x01020304';
const allowance = await libAssetData.getAssetProxyAllowance.callAsync(tokenOwnerAddress, fakeAssetData);
expect(allowance).to.bignumber.equal(constants.ZERO_AMOUNT);
});
it('should return an allowance of MAX_UINT256 for any staticCallAssetData', async () => {
const staticCallData = AssetProxyId.StaticCall;
const assetData = assetDataUtils.encodeStaticCallAssetData(
staticCallTarget.address,
staticCallData,
constants.KECCAK256_NULL,
);
const allowance = await libAssetData.getAssetProxyAllowance.callAsync(tokenOwnerAddress, assetData);
expect(allowance).to.bignumber.equal(constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS);
});
});
describe('getBatchBalances', () => {
it('should query balances for a batch of asset data strings', async () => {
const erc20AssetData = assetDataUtils.encodeERC20AssetData(erc20Token.address);
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721Token.address, firstERC721TokenId);
expect(
await libAssetData.getBatchBalances.callAsync(tokenOwnerAddress, [erc20AssetData, erc721AssetData]),
).to.deep.equal([new BigNumber(erc20TokenTotalSupply), new BigNumber(1)]);
});
});
describe('getERC721TokenOwner', async () => {
it('should return the null address when tokenId is not owned', async () => {
const nonexistentTokenId = new BigNumber(1234567890);
expect(
await libAssetData.getERC721TokenOwner.callAsync(erc721Token.address, nonexistentTokenId),
).to.be.equal(constants.NULL_ADDRESS);
});
it('should return the owner address when tokenId is owned', async () => {
expect(
await libAssetData.getERC721TokenOwner.callAsync(erc721Token.address, firstERC721TokenId),
).to.be.equal(tokenOwnerAddress);
});
});
describe('getBalanceAndAllowance', () => {
it('should query balance and allowance together, from asset data', async () => {
const allowance = new BigNumber(1);
await erc20Token.approve.awaitTransactionSuccessAsync(erc20Proxy.address, allowance, {
from: tokenOwnerAddress,
});
const assetData = assetDataUtils.encodeERC20AssetData(erc20Token.address);
expect(
await libAssetData.getBalanceAndAssetProxyAllowance.callAsync(tokenOwnerAddress, assetData),
).to.deep.equal([new BigNumber(erc20TokenTotalSupply), allowance]);
});
});
describe('getBatchBalancesAndAllowances', () => {
it('should query balances and allowances together, from an asset data array', async () => {
const allowance = new BigNumber(1);
await erc20Token.approve.awaitTransactionSuccessAsync(erc20Proxy.address, allowance, {
from: tokenOwnerAddress,
});
const assetData = assetDataUtils.encodeERC20AssetData(erc20Token.address);
expect(
await libAssetData.getBatchBalancesAndAssetProxyAllowances.callAsync(tokenOwnerAddress, [assetData]),
).to.deep.equal([[new BigNumber(erc20TokenTotalSupply)], [allowance]]);
});
});
describe('getBatchAssetProxyAllowances', () => {
it('should query allowances for a batch of asset data strings', async () => {
const allowance = new BigNumber(1);
await erc20Token.approve.awaitTransactionSuccessAsync(erc20Proxy.address, allowance, {
from: tokenOwnerAddress,
});
await erc721Token.approve.awaitTransactionSuccessAsync(erc721Proxy.address, firstERC721TokenId, {
from: tokenOwnerAddress,
});
const erc20AssetData = assetDataUtils.encodeERC20AssetData(erc20Token.address);
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721Token.address, firstERC721TokenId);
expect(
await libAssetData.getBatchAssetProxyAllowances.callAsync(tokenOwnerAddress, [
erc20AssetData,
erc721AssetData,
]),
).to.deep.equal([new BigNumber(1), new BigNumber(1)]);
});
});
});
// tslint:disable:max-file-line-count

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