Compare commits

..

187 Commits

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

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

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

* top-level README.md: explain Python dependency

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

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

* CI fix: disable old yarn permission denied hack

Motivated by CI failure of previous commit.

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

Motivated by CI failure of previous commit.

* CI fix: remove hack of permissions for python libs

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

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

Ensure the code is parseable by running it through black.

* abi-gen/Py: expand Python linter usage

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

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

* abi-gen: re-enable Solidity linter

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

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

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

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

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

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

* replace error types in contract-wrappers

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

* update website and 0x.js

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

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

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

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

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

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

Change CHANGELOG.md from chronological to reverse chronological.

* json_schemas.py: fix version numbers

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

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

Install Python packages in dependency order, not in parallel.

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

* Fix python package dependency ordering...

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

* sra_client.py: reformat whitespace in doctest

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

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

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

* abi-gen/Py: doc contract method attributes

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

* sra_client.py: disable tests in CI

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

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

...except for the dummy tokens.

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

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

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

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

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

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

* sra_client.py: checksum address in doctest

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

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

* Update CHANGELOGs

* sra_client.py: make CHANGELOG be REVESE chrono.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* contract_wrappers.py: include all contracts

* Update CHANGELOGs

* abi-gen: rename variable

* abi-gen: refine comments

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

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

* better formatting and persist generated docs as circleci build artifacts

* store artifacts properly

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

* After all Pytest runs, show short test summary

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

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

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

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

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

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

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

* contract_wrappers.py: make Base methods public

Changed some methods on BaseContractWrapper to be public.

* contract_wrappers.py: remove unused method

* contract_wrappers.py: extract method

* abi-gen/Py: inline method

* contract_wrappers.py: fix bug in call()

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

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

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

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

* abi-gen/Py: rename method

* contract_wrappers/Py: simplify web3 func handling

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

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

* contract_wrappers.py: inline method

Inline and remove method BaseContractWrapper.contract_instance().

* contract_wrappers.py: pass Validator to *Method

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

* abi-gen/Py: BaseContractWrapper -> ContractMethod

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

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

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

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

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

* abi-gen/Py: adjust whitespace

* contract_wrappers.py: inline method

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

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

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

* contract_wrappers.py: remove private_key support

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

* contract_wrappers.py: inline method

* contract_wrappers.py: rm unused member variables

* contract_wrappers.py: rm unnecessary instance var

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

* update CHANGELOG.json
2019-08-01 12:47:52 -04:00
fabioberger
4eb0767834 Update deps in private packages 2019-08-01 14:56:23 +02:00
fragosti
92bb7808ce Remove react-modal-video from website types 2019-07-31 17:50:21 -07:00
fragosti
abfe7d1613 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/what_is_0x_video_embed 2019-07-31 17:13:58 -07:00
fragosti
6c72239365 Remove react-modal-video as a dep and use the sass directly 2019-07-31 17:06:10 -07:00
fragosti
8001daad8c Fix linting errors 2019-07-31 16:40:39 -07:00
fragosti
73a38ab4f4 Add sandwich video to landing page 2019-07-31 15:15:55 -07:00
David Sun
281c207921 Publish
- @0x/contracts-asset-proxy@2.2.4
 - @0x/contracts-coordinator@2.0.9
 - @0x/contracts-dev-utils@0.0.6
 - @0x/contracts-exchange-forwarder@3.0.8
 - @0x/contracts-exchange@2.1.10
 - @0x/contracts-extensions@4.0.4
 - @0x/contracts-multisig@3.1.10
2019-07-31 14:14:47 -07:00
David Sun
ae531eef5f Updated CHANGELOGS 2019-07-31 14:14:35 -07:00
David Sun
d8b11238e6 reverted changelog for packages not published 2019-07-31 14:02:18 -07:00
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
Jan-Gerrit Harms
f2db67ef02 Fixed prettier errors 2019-07-30 09:50:54 +02:00
Jan-Gerrit Harms
72b8ef33d9 Fixes #1998, still needs Integration testing 2019-07-29 21:39:21 +02:00
499 changed files with 65560 additions and 16439 deletions

View File

@@ -4,18 +4,23 @@ jobs:
build:
resource_class: medium+
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
environment:
CONTRACTS_COMMIT_HASH: '9ed05f5'
working_directory: ~/repo
steps:
- checkout
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
- run:
# HACK(albrow): Without this, yarn commands will sometimes
# fail with a "permission denied" error.
name: Set npm path
command: npm set prefix=/home/circleci/npm && echo 'export PATH=$HOME/circleci/npm/bin:$PATH' >> /home/circleci/.bashrc
# HACK(feuGeneA): commented out this hack as we're changing
# from a circleci-maintained container to a different
# container, and this hack may not apply anymore, as
# suggested by the non-existance of `/home/circleci/.bashrc`
# when running the command below.
# - run:
# # HACK(albrow): Without this, yarn commands will sometimes
# # fail with a "permission denied" error.
# name: Set npm path
# command: npm set prefix=/home/circleci/npm && echo 'export PATH=$HOME/circleci/npm/bin:$PATH' >> /home/circleci/.bashrc
- run:
name: install-yarn
command: npm install --global yarn@1.9.4
@@ -37,10 +42,12 @@ jobs:
path: ~/repo/packages/python-contract-wrappers/generated
- store_artifacts:
path: ~/repo/packages/abi-gen/test-cli/output
- store_artifacts:
path: ~/repo/packages/abi-gen-wrappers/generated_docs
build-website:
resource_class: medium+
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
working_directory: ~/repo
steps:
- restore_cache:
@@ -48,8 +55,9 @@ jobs:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: cd packages/website && yarn build:prod
test-contracts-ganache:
resource_class: medium+
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
working_directory: ~/repo
steps:
- restore_cache:
@@ -58,7 +66,7 @@ jobs:
- run: yarn wsrun test:circleci @0x/contracts-multisig @0x/contracts-utils @0x/contracts-exchange-libs @0x/contracts-erc20 @0x/contracts-erc721 @0x/contracts-erc1155 @0x/contracts-extensions @0x/contracts-asset-proxy @0x/contracts-exchange @0x/contracts-exchange-forwarder @0x/contracts-coordinator @0x/contracts-dev-utils
test-contracts-geth:
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
- image: 0xorg/devnet
working_directory: ~/repo
steps:
@@ -71,7 +79,7 @@ jobs:
test-publish:
resource_class: medium+
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
- image: 0xorg/verdaccio
working_directory: ~/repo
steps:
@@ -81,7 +89,7 @@ jobs:
- run: yarn test:publish:circleci
test-doc-generation:
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
working_directory: ~/repo
steps:
- restore_cache:
@@ -90,7 +98,7 @@ jobs:
- run: yarn test:generate_docs:circleci
test-rest:
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
working_directory: ~/repo
steps:
- restore_cache:
@@ -107,7 +115,6 @@ jobs:
- run: yarn wsrun test:circleci @0x/dev-utils
- run: yarn wsrun test:circleci @0x/json-schemas
- run: yarn wsrun test:circleci @0x/order-utils
- run: yarn wsrun test:circleci @0x/order-watcher
- run: yarn wsrun test:circleci @0x/sol-compiler
- run: yarn wsrun test:circleci @0x/sol-tracing-utils
- run: yarn wsrun test:circleci @0x/sol-doc
@@ -151,10 +158,6 @@ jobs:
key: coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/order-utils/coverage/lcov.info
- save_cache:
key: coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/order-watcher/coverage/lcov.info
- save_cache:
key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
paths:
@@ -178,18 +181,17 @@ jobs:
test-python:
working_directory: ~/repo
docker:
- image: circleci/python
- image: nikolaik/python-nodejs:python3.7-nodejs8
- image: 0xorg/ganache-cli:2.2.2
- image: 0xorg/launch-kit-ci
- image: 0xorg/launch-kit-backend:74bcc39
environment:
RPC_URL: http://localhost:8545
NETWORK_ID: 50
WHITELIST_ALL_TOKENS: True
command: bash -c "until curl -sfd'{\"method\":\"net_listening\"}' http://localhost:8545 | grep true; do continue; done; forever ts/lib/index.js"
command: |
sh -c "until printf 'POST /\r\nContent-Length: 26\r\n\r\n{\"method\":\"net_listening\"}' | nc localhost 8545 | grep true; do continue; done; node_modules/.bin/forever ts/lib/index.js"
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
- restore_cache:
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
@@ -208,7 +210,7 @@ jobs:
- run:
command: |
cd python-packages
./parallel coverage run setup.py test
./parallel_without_sra_client coverage run setup.py test
./build_docs
- save_cache:
key: coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }}
@@ -255,11 +257,9 @@ jobs:
test-rest-python:
working_directory: ~/repo
docker:
- image: circleci/python
- image: nikolaik/python-nodejs:python3.7-nodejs8
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
- restore_cache:
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- run:
@@ -283,11 +283,9 @@ jobs:
static-tests-python:
working_directory: ~/repo
docker:
- image: circleci/python
- image: nikolaik/python-nodejs:python3.7-nodejs8
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
- restore_cache:
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
@@ -302,7 +300,7 @@ jobs:
static-tests:
working_directory: ~/repo
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
steps:
- restore_cache:
keys:
@@ -314,7 +312,7 @@ jobs:
- run: yarn bundlewatch
submit-coverage:
docker:
- image: circleci/node:9-browsers
- image: nikolaik/python-nodejs:python3.7-nodejs8
working_directory: ~/repo
steps:
- restore_cache:
@@ -347,9 +345,6 @@ jobs:
- restore_cache:
keys:
- coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}

1
.gitattributes vendored
View File

@@ -4,4 +4,5 @@
*.svg linguist-generated=true
packages/contract-artifacts/artifacts/*json linguist-generated=true
packages/abi-gen-wrappers/src/generated-wrappers/*.ts linguist-generated=true
packages/contract-wrappers/src/generated-wrappers/*.ts linguist-generated=true

View File

@@ -21,7 +21,6 @@ contracts: ['contracts']
@0x/utils: ['packages/utils']
@0x/tslint-config: ['packages/tslint-config']
@0x/asset-buyer: ['packages/asset-buyer']
@0x/order-watcher: ['packages/order-watcher']
@0x/order-utils: ['packages/order-utils']
@0x/assert: ['packages/assert']
@0x/base-contract: ['packages/base-contract']

21
.gitignore vendored
View File

@@ -114,9 +114,24 @@ contracts/exchange-forwarder/generated-wrappers/
contracts/dev-utils/generated-wrappers/
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_token/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/exchange/__init__.py
# cli test output
packages/abi-gen/test-cli/output
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/asset_proxy_owner/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/coordinator/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/coordinator_registry/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/dummy_erc20_token/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/dummy_erc721_token/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/dutch_auction/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_proxy/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc721_proxy/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc721_token/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/eth_balance_checker/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/forwarder/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/i_asset_proxy/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/i_validator/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/i_wallet/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/multi_asset_proxy/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/order_validator/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/weth9/__init__.py
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/zrx_token/__init__.py
# solc-bin in sol-compiler
packages/sol-compiler/solc_bin/

View File

@@ -28,6 +28,7 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [`0x-contract-addresses`](/python-packages/contract_addresses) | [![PyPI](https://img.shields.io/pypi/v/0x-contract-addresses.svg)](https://pypi.org/project/0x-contract-addresses/) | A tiny utility library for getting known deployed contract addresses for a particular network |
| [`0x-contract-artifacts`](/python-packages/contract_artifacts) | [![PyPI](https://img.shields.io/pypi/v/0x-contract-artifacts.svg)](https://pypi.org/project/0x-contract-artifacts/) | 0x smart contract compilation artifacts |
| [`0x-contract-wrappers`](/python-packages/contract_wrappers) | [![PyPI](https://img.shields.io/pypi/v/0x-contract-wrappers.svg)](https://pypi.org/project/0x-contract-wrappers/) | 0x smart contract wrappers |
| [`0x-json-schemas`](/python-packages/json_schemas) | [![PyPI](https://img.shields.io/pypi/v/0x-json-schemas.svg)](https://pypi.org/project/0x-json-schemas/) | 0x-related JSON schemas |
| [`0x-order-utils`](/python-packages/order_utils) | [![PyPI](https://img.shields.io/pypi/v/0x-order-utils.svg)](https://pypi.org/project/0x-order-utils/) | A set of utilities for generating, parsing, signing and validating 0x orders |
| [`0x-sra-client`](/python-packages/sra_client) | [![PyPI](https://img.shields.io/pypi/v/0x-sra-client.svg)](https://pypi.org/project/0x-sra-client/) | A Python client for interacting with servers conforming to the Standard Relayer API specification |
@@ -62,8 +63,7 @@ These packages are all under development. See [/contracts/README.md](/contracts/
| [`@0x/contract-addresses`](/packages/contract-addresses) | [![npm](https://img.shields.io/npm/v/@0x/contract-addresses.svg)](https://www.npmjs.com/package/@0x/contract-addresses) | A tiny utility library for getting known deployed contract addresses for a particular network. |
| [`@0x/contract-wrappers`](/packages/contract-wrappers) | [![npm](https://img.shields.io/npm/v/@0x/contract-wrappers.svg)](https://www.npmjs.com/package/@0x/contract-wrappers) | JS/TS wrappers for interacting with the 0x smart contracts |
| [`@0x/order-utils`](/packages/order-utils) | [![npm](https://img.shields.io/npm/v/@0x/order-utils.svg)](https://www.npmjs.com/package/@0x/order-utils) | A set of utilities for generating, parsing, signing and validating 0x orders |
| [`@0x/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0x/json-schemas.svg)](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas |
| [`@0x/order-watcher`](/packages/order-watcher) | [![npm](https://img.shields.io/npm/v/@0x/order-watcher.svg)](https://www.npmjs.com/package/@0x/order-watcher) | An order watcher daemon that watches for order validity |
| [`@0x/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0x/json-schemas.svg)](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas | |
| [`@0x/migrations`](/packages/migrations) | [![npm](https://img.shields.io/npm/v/@0x/migrations.svg)](https://www.npmjs.com/package/@0x/migrations) | Migration tool for deploying 0x smart contracts on private testnets |
| [`@0x/contract-artifacts`](/packages/contract-artifacts) | [![npm](https://img.shields.io/npm/v/@0x/contract-artifacts.svg)](https://www.npmjs.com/package/@0x/contract-artifacts) | 0x smart contract compilation artifacts |
| [`@0x/abi-gen-wrappers`](/packages/abi-gen-wrappers) | [![npm](https://img.shields.io/npm/v/@0x/abi-gen-wrappers.svg)](https://www.npmjs.com/package/@0x/abi-gen-wrappers) | Low-level 0x smart contract wrappers generated using `@0x/abi-gen` |
@@ -109,7 +109,7 @@ These packages are all under development. See [/contracts/README.md](/contracts/
## Usage
Node version >= 6.12 is required.
Node version 6.x or 8.x is required.
Most of the packages require additional typings for external dependencies.
You can include those by prepending the `@0x/typescript-typings` package to your [`typeRoots`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) config.
@@ -138,6 +138,8 @@ Then install dependencies
yarn install
```
You will also need to have Python 3 installed, in order to build and run the tests of `abi-gen`'s command-line interface, which is integrated with the yarn build, yarn test, and yarn lint commands described below. More specifically, your local pip should resolve to the Python 3 version of pip, not a Python 2.x version.
### Build
To build all packages:

View File

@@ -1,4 +1,22 @@
[
{
"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": [
@@ -7,7 +25,7 @@
"pr": 1995
}
],
"timestamp": 1564604963
"timestamp": 1564607468
},
{
"timestamp": 1563957393,

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v2.2.6 - _August 22, 2019_
* Dependencies updated
## v2.2.5 - _August 8, 2019_
* Dependencies updated
## v2.2.4 - _July 31, 2019_
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-asset-proxy",
"version": "2.2.4",
"version": "2.2.6",
"engines": {
"node": ">=6.12"
},
@@ -47,11 +47,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
"@0x/sol-compiler": "^3.1.11",
"@0x/abi-gen": "^4.1.1",
"@0x/contracts-gen": "^1.0.13",
"@0x/contracts-test-utils": "^3.1.14",
"@0x/dev-utils": "^2.3.1",
"@0x/sol-compiler": "^3.1.13",
"@0x/tslint-config": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
@@ -69,16 +69,16 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/contracts-erc1155": "^1.1.11",
"@0x/contracts-erc20": "^2.2.10",
"@0x/contracts-erc721": "^2.1.11",
"@0x/contracts-utils": "^3.2.0",
"@0x/order-utils": "^8.2.4",
"@0x/base-contract": "^5.3.2",
"@0x/contracts-erc1155": "^1.1.13",
"@0x/contracts-erc20": "^2.2.12",
"@0x/contracts-erc721": "^2.1.13",
"@0x/contracts-utils": "^3.2.2",
"@0x/order-utils": "^8.3.0",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.11"

View File

@@ -1,4 +1,22 @@
[
{
"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": [
@@ -7,7 +25,7 @@
"pr": 1995
}
],
"timestamp": 1564604963
"timestamp": 1564607468
},
{
"timestamp": 1563957393,

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v2.0.11 - _August 22, 2019_
* Dependencies updated
## v2.0.10 - _August 8, 2019_
* Dependencies updated
## v2.0.9 - _July 31, 2019_
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-coordinator",
"version": "2.0.9",
"version": "2.0.11",
"engines": {
"node": ">=6.12"
},
@@ -47,11 +47,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
"@0x/sol-compiler": "^3.1.11",
"@0x/abi-gen": "^4.1.1",
"@0x/contracts-gen": "^1.0.13",
"@0x/contracts-test-utils": "^3.1.14",
"@0x/dev-utils": "^2.3.1",
"@0x/sol-compiler": "^3.1.13",
"@0x/tslint-config": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
@@ -69,17 +69,17 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/contracts-asset-proxy": "^2.2.4",
"@0x/contracts-erc20": "^2.2.10",
"@0x/contracts-exchange": "^2.1.10",
"@0x/contracts-exchange-libs": "^3.0.4",
"@0x/contracts-utils": "^3.2.0",
"@0x/order-utils": "^8.2.4",
"@0x/base-contract": "^5.3.2",
"@0x/contracts-asset-proxy": "^2.2.6",
"@0x/contracts-erc20": "^2.2.12",
"@0x/contracts-exchange": "^2.1.12",
"@0x/contracts-exchange-libs": "^3.0.6",
"@0x/contracts-utils": "^3.2.2",
"@0x/order-utils": "^8.3.0",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.11"

View File

@@ -1,6 +1,33 @@
[
{
"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.",

View File

@@ -5,8 +5,20 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.0.8 - _August 22, 2019_
* Dependencies updated
## v0.0.7 - _August 8, 2019_
* Dependencies updated
## v0.0.6 - _July 31, 2019_
* Dependencies updated
## v0.0.5 - _July 31, 2019_
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
## v0.0.5 - _July 24, 2019_

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-dev-utils",
"version": "0.0.6",
"version": "0.0.8",
"engines": {
"node": ">=6.12"
},
@@ -47,12 +47,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/dev-utils/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contract-wrappers": "^10.1.0",
"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
"@0x/sol-compiler": "^3.1.11",
"@0x/abi-gen": "^4.1.1",
"@0x/contracts-gen": "^1.0.13",
"@0x/contracts-test-utils": "^3.1.14",
"@0x/dev-utils": "^2.3.1",
"@0x/sol-compiler": "^3.1.13",
"@0x/tslint-config": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
@@ -70,19 +69,19 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/contracts-asset-proxy": "^2.2.4",
"@0x/contracts-erc1155": "^1.1.11",
"@0x/contracts-erc20": "^2.2.10",
"@0x/contracts-erc721": "^2.1.11",
"@0x/contracts-exchange": "^2.1.10",
"@0x/contracts-exchange-libs": "^3.0.4",
"@0x/contracts-utils": "^3.2.0",
"@0x/order-utils": "^8.2.4",
"@0x/base-contract": "^5.3.2",
"@0x/contracts-asset-proxy": "^2.2.6",
"@0x/contracts-erc1155": "^1.1.13",
"@0x/contracts-erc20": "^2.2.12",
"@0x/contracts-erc721": "^2.1.13",
"@0x/contracts-exchange": "^2.1.12",
"@0x/contracts-exchange-libs": "^3.0.6",
"@0x/contracts-utils": "^3.2.2",
"@0x/order-utils": "^8.3.0",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"ethereumjs-util": "^5.1.1"
},

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1566446343,
"version": "1.1.13",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1565296576,
"version": "1.1.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "1.1.11",
"changes": [

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.1.13 - _August 22, 2019_
* Dependencies updated
## v1.1.12 - _August 8, 2019_
* Dependencies updated
## v1.1.11 - _July 31, 2019_
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-erc1155",
"version": "1.1.11",
"version": "1.1.13",
"engines": {
"node": ">=6.12"
},
@@ -47,10 +47,10 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contracts-gen": "^1.0.12",
"@0x/dev-utils": "^2.2.6",
"@0x/sol-compiler": "^3.1.11",
"@0x/abi-gen": "^4.1.1",
"@0x/contracts-gen": "^1.0.13",
"@0x/dev-utils": "^2.3.1",
"@0x/sol-compiler": "^3.1.13",
"@0x/tslint-config": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
@@ -68,13 +68,13 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/contracts-utils": "^3.2.0",
"@0x/base-contract": "^5.3.2",
"@0x/contracts-test-utils": "^3.1.14",
"@0x/contracts-utils": "^3.2.2",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1566446343,
"version": "2.2.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1565296576,
"version": "2.2.11",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "2.2.10",
"changes": [

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v2.2.12 - _August 22, 2019_
* Dependencies updated
## v2.2.11 - _August 8, 2019_
* Dependencies updated
## v2.2.10 - _July 31, 2019_
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-erc20",
"version": "2.2.10",
"version": "2.2.12",
"engines": {
"node": ">=6.12"
},
@@ -47,11 +47,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
"@0x/sol-compiler": "^3.1.11",
"@0x/abi-gen": "^4.1.1",
"@0x/contracts-gen": "^1.0.13",
"@0x/contracts-test-utils": "^3.1.14",
"@0x/dev-utils": "^2.3.1",
"@0x/sol-compiler": "^3.1.13",
"@0x/tslint-config": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
@@ -69,12 +69,12 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/contracts-utils": "^3.2.0",
"@0x/base-contract": "^5.3.2",
"@0x/contracts-utils": "^3.2.2",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1566446343,
"version": "2.1.13",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1565296576,
"version": "2.1.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "2.1.11",
"changes": [

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v2.1.13 - _August 22, 2019_
* Dependencies updated
## v2.1.12 - _August 8, 2019_
* Dependencies updated
## v2.1.11 - _July 31, 2019_
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-erc721",
"version": "2.1.11",
"version": "2.1.13",
"engines": {
"node": ">=6.12"
},
@@ -47,11 +47,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
"@0x/sol-compiler": "^3.1.11",
"@0x/abi-gen": "^4.1.1",
"@0x/contracts-gen": "^1.0.13",
"@0x/contracts-test-utils": "^3.1.14",
"@0x/dev-utils": "^2.3.1",
"@0x/sol-compiler": "^3.1.13",
"@0x/tslint-config": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
@@ -69,12 +69,12 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/contracts-utils": "^3.2.0",
"@0x/base-contract": "^5.3.2",
"@0x/contracts-utils": "^3.2.2",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1566446343,
"version": "3.0.10",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1565296576,
"version": "3.0.9",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "3.0.8",
"changes": [
@@ -7,7 +25,7 @@
"pr": 1995
}
],
"timestamp": 1564604963
"timestamp": 1564607468
},
{
"timestamp": 1563957393,

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v3.0.10 - _August 22, 2019_
* Dependencies updated
## v3.0.9 - _August 8, 2019_
* Dependencies updated
## v3.0.8 - _July 31, 2019_
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-exchange-forwarder",
"version": "3.0.8",
"version": "3.0.10",
"engines": {
"node": ">=6.12"
},
@@ -46,12 +46,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contract-wrappers": "^10.1.0",
"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
"@0x/sol-compiler": "^3.1.11",
"@0x/abi-gen": "^4.1.1",
"@0x/contracts-gen": "^1.0.13",
"@0x/contracts-test-utils": "^3.1.14",
"@0x/dev-utils": "^2.3.1",
"@0x/sol-compiler": "^3.1.13",
"@0x/tslint-config": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
@@ -69,18 +68,18 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/contracts-asset-proxy": "^2.2.4",
"@0x/contracts-erc20": "^2.2.10",
"@0x/contracts-erc721": "^2.1.11",
"@0x/contracts-exchange": "^2.1.10",
"@0x/contracts-exchange-libs": "^3.0.4",
"@0x/contracts-utils": "^3.2.0",
"@0x/order-utils": "^8.2.4",
"@0x/base-contract": "^5.3.2",
"@0x/contracts-asset-proxy": "^2.2.6",
"@0x/contracts-erc20": "^2.2.12",
"@0x/contracts-erc721": "^2.1.13",
"@0x/contracts-exchange": "^2.1.12",
"@0x/contracts-exchange-libs": "^3.0.6",
"@0x/contracts-utils": "^3.2.2",
"@0x/order-utils": "^8.3.0",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1566446343,
"version": "3.0.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1565296576,
"version": "3.0.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "3.0.4",
"changes": [

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v3.0.6 - _August 22, 2019_
* Dependencies updated
## v3.0.5 - _August 8, 2019_
* Dependencies updated
## v3.0.4 - _July 31, 2019_
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-exchange-libs",
"version": "3.0.4",
"version": "3.0.6",
"engines": {
"node": ">=6.12"
},
@@ -47,11 +47,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/libs/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
"@0x/sol-compiler": "^3.1.11",
"@0x/abi-gen": "^4.1.1",
"@0x/contracts-gen": "^1.0.13",
"@0x/contracts-test-utils": "^3.1.14",
"@0x/dev-utils": "^2.3.1",
"@0x/sol-compiler": "^3.1.13",
"@0x/tslint-config": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
@@ -69,13 +69,13 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/contracts-utils": "^3.2.0",
"@0x/order-utils": "^8.2.4",
"@0x/base-contract": "^5.3.2",
"@0x/contracts-utils": "^3.2.2",
"@0x/order-utils": "^8.3.0",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1566446343,
"version": "2.1.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1565296576,
"version": "2.1.11",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "2.1.10",
"changes": [
@@ -7,7 +25,7 @@
"pr": 1995
}
],
"timestamp": 1564604963
"timestamp": 1564607468
},
{
"timestamp": 1563957393,

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v2.1.12 - _August 22, 2019_
* Dependencies updated
## v2.1.11 - _August 8, 2019_
* Dependencies updated
## v2.1.10 - _July 31, 2019_
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)

View File

@@ -21,7 +21,7 @@ pragma solidity ^0.5.5;
import "../src/interfaces/IValidator.sol";
contract Validator is
contract Validator is
IValidator
{
@@ -39,7 +39,7 @@ contract Validator is
/// @param hash Message hash that is signed.
/// @param signerAddress Address that should have signed the given hash.
/// @param signature Proof of signing.
/// @return Validity of signature.
/// @return Returns a known magic value if the signature is valid.
// solhint-disable no-unused-vars
function isValidSignature(
bytes32 hash,
@@ -48,9 +48,11 @@ contract Validator is
)
external
view
returns (bool isValid)
returns (bytes4)
{
return (signerAddress == VALID_SIGNER);
require(signerAddress == VALID_SIGNER, "INVALID_SIGNER");
bytes4 magicValue = bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"));
return magicValue;
}
// solhint-enable no-unused-vars
}

View File

@@ -22,7 +22,7 @@ import "../src/interfaces/IWallet.sol";
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
contract Wallet is
contract Wallet is
IWallet
{
using LibBytes for bytes;
@@ -41,14 +41,14 @@ contract Wallet is
/// The signer must match the owner of this wallet.
/// @param hash Message hash that is signed.
/// @param eip712Signature Proof of signing.
/// @return Validity of signature.
/// @return Returns a known magic value if the signature is valid.
function isValidSignature(
bytes32 hash,
bytes calldata eip712Signature
)
external
view
returns (bool isValid)
returns (bytes4)
{
require(
eip712Signature.length == 65,
@@ -59,7 +59,8 @@ contract Wallet is
bytes32 r = eip712Signature.readBytes32(1);
bytes32 s = eip712Signature.readBytes32(33);
address recoveredAddress = ecrecover(hash, v, r, s);
isValid = WALLET_OWNER == recoveredAddress;
return isValid;
require(WALLET_OWNER == recoveredAddress, "INVALID_SIGNATURE");
bytes4 magicValue = bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"));
return magicValue;
}
}

View File

@@ -73,10 +73,12 @@ contract Whitelist is
)
external
view
returns (bool isValid)
returns (bytes4)
{
// solhint-disable-next-line avoid-tx-origin
return signerAddress == tx.origin;
require(signerAddress == tx.origin, "INVALID_SIGNER");
bytes4 magicValue = bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"));
return magicValue;
}
// solhint-enable no-unused-vars

View File

@@ -32,7 +32,7 @@ contract MixinSignatureValidator is
MTransactions
{
using LibBytes for bytes;
// Mapping of hash => signer => signed
mapping (bytes32 => mapping (address => bool)) public preSigned;
@@ -197,7 +197,7 @@ contract MixinSignatureValidator is
} else if (signatureType == SignatureType.Validator) {
// Pop last 20 bytes off of signature byte array.
address validatorAddress = signature.popLast20Bytes();
// Ensure signer has approved validator.
if (!allowedValidators[signerAddress][validatorAddress]) {
return false;
@@ -224,7 +224,8 @@ contract MixinSignatureValidator is
revert("SIGNATURE_UNSUPPORTED");
}
/// @dev Verifies signature using logic defined by Wallet contract.
/// @dev Verifies signature using logic defined by Wallet contract. Wallet contract
/// must return `bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"))`
/// @param hash Any 32 byte hash.
/// @param walletAddress Address that should have signed the given hash
/// and defines its own signature verification method.
@@ -244,7 +245,19 @@ contract MixinSignatureValidator is
hash,
signature
);
// bytes4 0xb0671381
bytes32 magicValue = bytes32(bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)")));
assembly {
// extcodesize added as an extra safety measure
if iszero(extcodesize(walletAddress)) {
// Revert with `Error("WALLET_ERROR")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)
mstore(96, 0)
revert(0, 100)
}
let cdStart := add(callData, 32)
let success := staticcall(
gas, // forward all gas
@@ -255,6 +268,15 @@ contract MixinSignatureValidator is
32 // output size is 32 bytes
)
if iszero(eq(returndatasize(), 32)) {
// Revert with `Error("WALLET_ERROR")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)
mstore(96, 0)
revert(0, 100)
}
switch success
case 0 {
// Revert with `Error("WALLET_ERROR")`
@@ -266,13 +288,17 @@ contract MixinSignatureValidator is
}
case 1 {
// Signature is valid if call did not revert and returned true
isValid := mload(cdStart)
isValid := eq(
and(mload(cdStart), 0xffffffff00000000000000000000000000000000000000000000000000000000),
and(magicValue, 0xffffffff00000000000000000000000000000000000000000000000000000000)
)
}
}
return isValid;
}
/// @dev Verifies signature using logic defined by Validator contract.
/// Validator must return `bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"))`
/// @param validatorAddress Address of validator contract.
/// @param hash Any 32 byte hash.
/// @param signerAddress Address that should have signed the given hash.
@@ -294,7 +320,19 @@ contract MixinSignatureValidator is
signerAddress,
signature
);
// bytes4 0x42b38674
bytes32 magicValue = bytes32(bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)")));
assembly {
// extcodesize added as an extra safety measure
if iszero(extcodesize(validatorAddress)) {
// Revert with `Error("VALIDATOR_ERROR")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)
mstore(96, 0)
revert(0, 100)
}
let cdStart := add(callData, 32)
let success := staticcall(
gas, // forward all gas
@@ -305,6 +343,15 @@ contract MixinSignatureValidator is
32 // output size is 32 bytes
)
if iszero(eq(returndatasize(), 32)) {
// Revert with `Error("VALIDATOR_ERROR")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)
mstore(96, 0)
revert(0, 100)
}
switch success
case 0 {
// Revert with `Error("VALIDATOR_ERROR")`
@@ -316,7 +363,10 @@ contract MixinSignatureValidator is
}
case 1 {
// Signature is valid if call did not revert and returned true
isValid := mload(cdStart)
isValid := eq(
and(mload(cdStart), 0xffffffff00000000000000000000000000000000000000000000000000000000),
and(magicValue, 0xffffffff00000000000000000000000000000000000000000000000000000000)
)
}
}
return isValid;

View File

@@ -25,7 +25,8 @@ contract IValidator {
/// @param hash Message hash that is signed.
/// @param signerAddress Address that should have signed the given hash.
/// @param signature Proof of signing.
/// @return Validity of order signature.
/// @return Magic bytes4 value if the signature is valid.
/// Magic value is bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"))
function isValidSignature(
bytes32 hash,
address signerAddress,
@@ -33,5 +34,5 @@ contract IValidator {
)
external
view
returns (bool isValid);
returns (bytes4);
}

View File

@@ -24,12 +24,13 @@ contract IWallet {
/// @dev Verifies that a signature is valid.
/// @param hash Message hash that is signed.
/// @param signature Proof of signing.
/// @return Validity of order signature.
/// @return Magic bytes4 value if the signature is valid.
/// Magic value is bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"))
function isValidSignature(
bytes32 hash,
bytes calldata signature
)
external
view
returns (bool isValid);
returns (bytes4);
}

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-exchange",
"version": "2.1.10",
"version": "2.1.12",
"engines": {
"node": ">=6.12"
},
@@ -47,11 +47,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
"@0x/sol-compiler": "^3.1.11",
"@0x/abi-gen": "^4.1.1",
"@0x/contracts-gen": "^1.0.13",
"@0x/contracts-test-utils": "^3.1.14",
"@0x/dev-utils": "^2.3.1",
"@0x/sol-compiler": "^3.1.13",
"@0x/tslint-config": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
@@ -69,18 +69,18 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/contracts-asset-proxy": "^2.2.4",
"@0x/contracts-erc1155": "^1.1.11",
"@0x/contracts-erc20": "^2.2.10",
"@0x/contracts-erc721": "^2.1.11",
"@0x/contracts-exchange-libs": "^3.0.4",
"@0x/contracts-utils": "^3.2.0",
"@0x/order-utils": "^8.2.4",
"@0x/base-contract": "^5.3.2",
"@0x/contracts-asset-proxy": "^2.2.6",
"@0x/contracts-erc1155": "^1.1.13",
"@0x/contracts-erc20": "^2.2.12",
"@0x/contracts-erc721": "^2.1.13",
"@0x/contracts-exchange-libs": "^3.0.6",
"@0x/contracts-utils": "^3.2.2",
"@0x/order-utils": "^8.3.0",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.11"

View File

@@ -100,6 +100,12 @@ describe('MixinSignatureValidator', () => {
),
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await signatureValidator.setSignatureValidatorApproval.sendTransactionAsync(testValidator.address, true, {
from: notSignerAddress,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
const defaultOrderParams = {
...constants.STATIC_ORDER_PARAMS,
@@ -307,7 +313,7 @@ describe('MixinSignatureValidator', () => {
expect(isValidSignature).to.be.true();
});
it('should return false when SignatureType=Wallet and signature is invalid', async () => {
it('should revert when SignatureType=Wallet and signature is invalid', async () => {
// Create EIP712 signature using a private key that does not belong to the wallet owner.
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
const orderHashBuffer = ethUtil.toBuffer(orderHashHex);
@@ -322,12 +328,10 @@ describe('MixinSignatureValidator', () => {
]);
const signatureHex = ethUtil.bufferToHex(signature);
// Validate signature
const isValidSignature = await signatureValidator.publicIsValidSignature.callAsync(
orderHashHex,
testWallet.address,
signatureHex,
return expectContractCallFailedAsync(
signatureValidator.publicIsValidSignature.callAsync(orderHashHex, testWallet.address, signatureHex),
RevertReason.WalletError,
);
expect(isValidSignature).to.be.false();
});
it('should revert when `isValidSignature` attempts to update state and SignatureType=Wallet', async () => {
@@ -365,6 +369,15 @@ describe('MixinSignatureValidator', () => {
signatureHex,
);
expect(isValidSignature).to.be.true();
const isValidSignatureTs = await signatureUtils.isValidSignatureAsync(
provider,
orderHashHex,
signatureHex,
signerAddress,
signatureValidator.address,
);
expect(isValidSignatureTs).to.be.true();
});
it('should return false when SignatureType=Validator, signature is invalid and validator is approved', async () => {
@@ -375,12 +388,19 @@ describe('MixinSignatureValidator', () => {
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
// This will return false because we signed the message with `signerAddress`, but
// are validating against `notSignerAddress`
const isValidSignature = await signatureValidator.publicIsValidSignature.callAsync(
orderHashHex,
notSignerAddress,
signatureHex,
await expectContractCallFailedAsync(
signatureValidator.publicIsValidSignature.callAsync(orderHashHex, notSignerAddress, signatureHex),
RevertReason.ValidatorError,
);
expect(isValidSignature).to.be.false();
const isValidSignatureTs = await signatureUtils.isValidSignatureAsync(
provider,
orderHashHex,
signatureHex,
notSignerAddress,
signatureValidator.address,
);
expect(isValidSignatureTs).to.be.false();
});
it('should revert when `isValidSignature` attempts to update state and SignatureType=Validator', async () => {
@@ -416,6 +436,16 @@ describe('MixinSignatureValidator', () => {
signatureHex,
);
expect(isValidSignature).to.be.false();
expect(
signatureUtils.isValidSignatureAsync(
provider,
orderHashHex,
signatureHex,
signerAddress,
signatureValidator.address,
),
).to.be.rejected();
});
it('should return true when SignatureType=Presigned and signer has presigned hash', async () => {

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1566446343,
"version": "4.0.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1565296576,
"version": "4.0.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "4.0.4",
"changes": [
@@ -7,7 +25,7 @@
"pr": 1995
}
],
"timestamp": 1564604963
"timestamp": 1564607468
},
{
"timestamp": 1563957393,

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v4.0.6 - _August 22, 2019_
* Dependencies updated
## v4.0.5 - _August 8, 2019_
* Dependencies updated
## v4.0.4 - _July 31, 2019_
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-extensions",
"version": "4.0.4",
"version": "4.0.6",
"engines": {
"node": ">=6.12"
},
@@ -47,12 +47,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contract-wrappers": "^10.1.0",
"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
"@0x/sol-compiler": "^3.1.11",
"@0x/abi-gen": "^4.1.1",
"@0x/contracts-gen": "^1.0.13",
"@0x/contracts-test-utils": "^3.1.14",
"@0x/dev-utils": "^2.3.1",
"@0x/sol-compiler": "^3.1.13",
"@0x/tslint-config": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
@@ -70,18 +69,18 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/contracts-asset-proxy": "^2.2.4",
"@0x/contracts-erc20": "^2.2.10",
"@0x/contracts-erc721": "^2.1.11",
"@0x/contracts-exchange": "^2.1.10",
"@0x/contracts-exchange-libs": "^3.0.4",
"@0x/contracts-utils": "^3.2.0",
"@0x/order-utils": "^8.2.4",
"@0x/base-contract": "^5.3.2",
"@0x/contracts-asset-proxy": "^2.2.6",
"@0x/contracts-erc20": "^2.2.12",
"@0x/contracts-erc721": "^2.1.13",
"@0x/contracts-exchange": "^2.1.12",
"@0x/contracts-exchange-libs": "^3.0.6",
"@0x/contracts-utils": "^3.2.2",
"@0x/order-utils": "^8.3.0",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},

View File

@@ -1,4 +1,3 @@
import { DutchAuctionWrapper } from '@0x/contract-wrappers';
import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
import { DummyERC20TokenContract } from '@0x/contracts-erc20';
import { DummyERC721TokenContract } from '@0x/contracts-erc721';
@@ -151,7 +150,7 @@ describe(ContractName.DutchAuction, () => {
feeRecipientAddress,
// taker address or sender address should be set to the ducth auction contract
takerAddress: dutchAuctionContract.address,
makerAssetData: DutchAuctionWrapper.encodeDutchAuctionAssetData(
makerAssetData: assetDataUtils.encodeDutchAuctionAssetData(
assetDataUtils.encodeERC20AssetData(defaultMakerAssetAddress),
auctionBeginTimeSeconds,
auctionBeginAmount,
@@ -193,7 +192,7 @@ describe(ContractName.DutchAuction, () => {
describe('matchOrders', () => {
it('should be worth the begin price at the begining of the auction', async () => {
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp + 2);
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
defaultERC20MakerAssetData,
auctionBeginTimeSeconds,
auctionBeginAmount,
@@ -207,7 +206,7 @@ describe(ContractName.DutchAuction, () => {
it('should be be worth the end price at the end of the auction', async () => {
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds * 2);
auctionEndTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds);
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
defaultERC20MakerAssetData,
auctionBeginTimeSeconds,
auctionBeginAmount,
@@ -273,7 +272,7 @@ describe(ContractName.DutchAuction, () => {
it('should revert when auction expires', async () => {
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds * 2);
auctionEndTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds);
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
defaultERC20MakerAssetData,
auctionBeginTimeSeconds,
auctionBeginAmount,
@@ -307,7 +306,7 @@ describe(ContractName.DutchAuction, () => {
});
it('begin time is less than end time', async () => {
auctionBeginTimeSeconds = new BigNumber(auctionEndTimeSeconds).plus(tenMinutesInSeconds);
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
defaultERC20MakerAssetData,
auctionBeginTimeSeconds,
auctionBeginAmount,
@@ -335,7 +334,7 @@ describe(ContractName.DutchAuction, () => {
it('should match orders when ERC721', async () => {
const makerAssetId = erc721MakerAssetIds[0];
const erc721MakerAssetData = assetDataUtils.encodeERC721AssetData(erc721Token.address, makerAssetId);
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
erc721MakerAssetData,
auctionBeginTimeSeconds,
auctionBeginAmount,

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1566446343,
"version": "3.1.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1565296576,
"version": "3.1.11",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "3.1.10",
"changes": [
@@ -7,7 +25,7 @@
"pr": 1995
}
],
"timestamp": 1564604963
"timestamp": 1564607468
},
{
"timestamp": 1563957393,

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v3.1.12 - _August 22, 2019_
* Dependencies updated
## v3.1.11 - _August 8, 2019_
* Dependencies updated
## v3.1.10 - _July 31, 2019_
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-multisig",
"version": "3.1.10",
"version": "3.1.12",
"engines": {
"node": ">=6.12"
},
@@ -47,11 +47,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/multisig/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
"@0x/sol-compiler": "^3.1.11",
"@0x/abi-gen": "^4.1.1",
"@0x/contracts-gen": "^1.0.13",
"@0x/contracts-test-utils": "^3.1.14",
"@0x/dev-utils": "^2.3.1",
"@0x/sol-compiler": "^3.1.13",
"@0x/tslint-config": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
@@ -69,14 +69,14 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/contracts-asset-proxy": "^2.2.4",
"@0x/contracts-erc20": "^2.2.10",
"@0x/base-contract": "^5.3.2",
"@0x/contracts-asset-proxy": "^2.2.6",
"@0x/contracts-erc20": "^2.2.12",
"@0x/contracts-utils": "2.0.1",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"lodash": "^4.17.11"
},

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1566446343,
"version": "3.1.14",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1565296576,
"version": "3.1.13",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1564604963,
"version": "3.1.12",

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v3.1.14 - _August 22, 2019_
* Dependencies updated
## v3.1.13 - _August 8, 2019_
* Dependencies updated
## v3.1.12 - _July 31, 2019_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-test-utils",
"version": "3.1.12",
"version": "3.1.14",
"engines": {
"node": ">=6.12"
},
@@ -42,18 +42,18 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/dev-utils": "^2.2.6",
"@0x/order-utils": "^8.2.4",
"@0x/sol-compiler": "^3.1.11",
"@0x/sol-coverage": "^3.0.8",
"@0x/sol-profiler": "^3.1.10",
"@0x/sol-trace": "^2.0.16",
"@0x/subproviders": "^5.0.0",
"@0x/dev-utils": "^2.3.1",
"@0x/order-utils": "^8.3.0",
"@0x/sol-compiler": "^3.1.13",
"@0x/sol-coverage": "^3.0.10",
"@0x/sol-profiler": "^3.1.12",
"@0x/sol-trace": "^2.0.18",
"@0x/subproviders": "^5.0.2",
"@0x/tslint-config": "^3.0.1",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"@types/bn.js": "^4.11.0",
"@types/js-combinatorics": "^0.5.29",
"@types/lodash": "4.14.104",

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1566446343,
"version": "3.2.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1565296576,
"version": "3.2.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "3.2.0",
"changes": [

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v3.2.2 - _August 22, 2019_
* Dependencies updated
## v3.2.1 - _August 8, 2019_
* Dependencies updated
## v3.2.0 - _July 31, 2019_
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-utils",
"version": "3.2.0",
"version": "3.2.2",
"engines": {
"node": ">=6.12"
},
@@ -47,11 +47,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/utils/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
"@0x/sol-compiler": "^3.1.11",
"@0x/abi-gen": "^4.1.1",
"@0x/contracts-gen": "^1.0.13",
"@0x/contracts-test-utils": "^3.1.14",
"@0x/dev-utils": "^2.3.1",
"@0x/sol-compiler": "^3.1.13",
"@0x/tslint-config": "^3.0.1",
"@types/bn.js": "^4.11.0",
"@types/lodash": "4.14.104",
@@ -70,12 +70,12 @@
"typescript": "3.0.1"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/order-utils": "^8.2.4",
"@0x/base-contract": "^5.3.2",
"@0x/order-utils": "^8.3.0",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"bn.js": "^4.11.8",
"ethereum-types": "^2.1.4",
"ethereumjs-util": "^5.1.1",

1
env/.Python vendored Symbolic link
View File

@@ -0,0 +1 @@
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/Python

84
env/bin/activate vendored Normal file
View File

@@ -0,0 +1,84 @@
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
if [ "${BASH_SOURCE-}" = "$0" ]; then
echo "You must source this script: \$ source $0" >&2
exit 33
fi
deactivate () {
unset -f pydoc >/dev/null 2>&1
# reset old environment variables
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all
if ! [ -z "${_OLD_VIRTUAL_PATH:+_}" ] ; then
PATH="$_OLD_VIRTUAL_PATH"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
hash -r 2>/dev/null
fi
if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
PS1="$_OLD_VIRTUAL_PS1"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
if [ ! "${1-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
if ! [ -z "${PYTHONHOME+_}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1-}"
if [ "x" != x ] ; then
PS1="${PS1-}"
else
PS1="(`basename \"$VIRTUAL_ENV\"`) ${PS1-}"
fi
export PS1
fi
# Make sure to unalias pydoc if it's already there
alias pydoc 2>/dev/null >/dev/null && unalias pydoc || true
pydoc () {
python -m pydoc "$@"
}
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
hash -r 2>/dev/null
fi

55
env/bin/activate.csh vendored Normal file
View File

@@ -0,0 +1,55 @@
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
set newline='\
'
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH:q" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT:q" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc'
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env"
set _OLD_VIRTUAL_PATH="$PATH:q"
setenv PATH "$VIRTUAL_ENV:q/bin:$PATH:q"
if ("" != "") then
set env_name = ""
else
set env_name = '('"$VIRTUAL_ENV:t:q"') '
endif
if ( $?VIRTUAL_ENV_DISABLE_PROMPT ) then
if ( $VIRTUAL_ENV_DISABLE_PROMPT == "" ) then
set do_prompt = "1"
else
set do_prompt = "0"
endif
else
set do_prompt = "1"
endif
if ( $do_prompt == "1" ) then
# Could be in a non-interactive environment,
# in which case, $prompt is undefined and we wouldn't
# care about the prompt anyway.
if ( $?prompt ) then
set _OLD_VIRTUAL_PROMPT="$prompt:q"
if ( "$prompt:q" =~ *"$newline:q"* ) then
:
else
set prompt = "$env_name:q$prompt:q"
endif
endif
endif
unset env_name
unset do_prompt
alias pydoc python -m pydoc
rehash

102
env/bin/activate.fish vendored Normal file
View File

@@ -0,0 +1,102 @@
# This file must be used using `source bin/activate.fish` *within a running fish ( http://fishshell.com ) session*.
# Do not run it directly.
function _bashify_path -d "Converts a fish path to something bash can recognize"
set fishy_path $argv
set bashy_path $fishy_path[1]
for path_part in $fishy_path[2..-1]
set bashy_path "$bashy_path:$path_part"
end
echo $bashy_path
end
function _fishify_path -d "Converts a bash path to something fish can recognize"
echo $argv | tr ':' '\n'
end
function deactivate -d 'Exit virtualenv mode and return to the normal environment.'
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
# https://github.com/fish-shell/fish-shell/issues/436 altered PATH handling
if test (echo $FISH_VERSION | tr "." "\n")[1] -lt 3
set -gx PATH (_fishify_path $_OLD_VIRTUAL_PATH)
else
set -gx PATH $_OLD_VIRTUAL_PATH
end
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PYTHONHOME
end
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
and functions -q _old_fish_prompt
# Set an empty local `$fish_function_path` to allow the removal of `fish_prompt` using `functions -e`.
set -l fish_function_path
# Erase virtualenv's `fish_prompt` and restore the original.
functions -e fish_prompt
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
end
set -e VIRTUAL_ENV
if test "$argv[1]" != 'nondestructive'
# Self-destruct!
functions -e pydoc
functions -e deactivate
functions -e _bashify_path
functions -e _fishify_path
end
end
# Unset irrelevant variables.
deactivate nondestructive
set -gx VIRTUAL_ENV "/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env"
# https://github.com/fish-shell/fish-shell/issues/436 altered PATH handling
if test (echo $FISH_VERSION | tr "." "\n")[1] -lt 3
set -gx _OLD_VIRTUAL_PATH (_bashify_path $PATH)
else
set -gx _OLD_VIRTUAL_PATH $PATH
end
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
# Unset `$PYTHONHOME` if set.
if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
set -e PYTHONHOME
end
function pydoc
python -m pydoc $argv
end
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# Copy the current `fish_prompt` function as `_old_fish_prompt`.
functions -c fish_prompt _old_fish_prompt
function fish_prompt
# Save the current $status, for fish_prompts that display it.
set -l old_status $status
# Prompt override provided?
# If not, just prepend the environment name.
if test -n ""
printf '%s%s' "" (set_color normal)
else
printf '%s(%s) ' (set_color normal) (basename "$VIRTUAL_ENV")
end
# Restore the original $status
echo "exit $old_status" | source
_old_fish_prompt
end
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
end

67
env/bin/activate.ps1 vendored Normal file
View File

@@ -0,0 +1,67 @@
# This file must be dot sourced from PoSh; you cannot run it directly. Do this: . ./activate.ps1
if (@($null,"Internal") -notcontains $myinvocation.commandorigin) {
Write-Host -Foreground red "You must 'source' this script: PS> . $($myinvocation.invocationname)"
exit 33
}
$script:THIS_PATH = $myinvocation.mycommand.path
$script:BASE_DIR = Split-Path (Resolve-Path "$THIS_PATH/..") -Parent
function global:deactivate([switch] $NonDestructive) {
if (Test-Path variable:_OLD_VIRTUAL_PATH) {
$env:PATH = $variable:_OLD_VIRTUAL_PATH
Remove-Variable "_OLD_VIRTUAL_PATH" -Scope global
}
if (Test-Path function:_old_virtual_prompt) {
$function:prompt = $function:_old_virtual_prompt
Remove-Item function:\_old_virtual_prompt
}
if ($env:VIRTUAL_ENV) {
Remove-Item env:VIRTUAL_ENV -ErrorAction SilentlyContinue
}
if (!$NonDestructive) {
# Self destruct!
Remove-Item function:deactivate
Remove-Item function:pydoc
}
}
function global:pydoc {
python -m pydoc $args
}
# unset irrelevant variables
deactivate -nondestructive
$VIRTUAL_ENV = $BASE_DIR
$env:VIRTUAL_ENV = $VIRTUAL_ENV
New-Variable -Scope global -Name _OLD_VIRTUAL_PATH -Value $env:PATH
$env:PATH = "$env:VIRTUAL_ENV/bin:" + $env:PATH
if (!$env:VIRTUAL_ENV_DISABLE_PROMPT) {
function global:_old_virtual_prompt {
""
}
$function:_old_virtual_prompt = $function:prompt
if ("" -ne "") {
function global:prompt {
# Add the custom prefix to the existing prompt
$previous_prompt_value = & $function:_old_virtual_prompt
("" + $previous_prompt_value)
}
}
else {
function global:prompt {
# Add a prefix to the current prompt, but don't discard it.
$previous_prompt_value = & $function:_old_virtual_prompt
$new_prompt_value = "($( Split-Path $env:VIRTUAL_ENV -Leaf )) "
($new_prompt_value + $previous_prompt_value)
}
}
}

46
env/bin/activate.xsh vendored Normal file
View File

@@ -0,0 +1,46 @@
"""Xonsh activate script for virtualenv"""
from xonsh.tools import get_sep as _get_sep
def _deactivate(args):
if "pydoc" in aliases:
del aliases["pydoc"]
if ${...}.get("_OLD_VIRTUAL_PATH", ""):
$PATH = $_OLD_VIRTUAL_PATH
del $_OLD_VIRTUAL_PATH
if ${...}.get("_OLD_VIRTUAL_PYTHONHOME", ""):
$PYTHONHOME = $_OLD_VIRTUAL_PYTHONHOME
del $_OLD_VIRTUAL_PYTHONHOME
if "VIRTUAL_ENV" in ${...}:
del $VIRTUAL_ENV
if "VIRTUAL_ENV_PROMPT" in ${...}:
del $VIRTUAL_ENV_PROMPT
if "nondestructive" not in args:
# Self destruct!
del aliases["deactivate"]
# unset irrelevant variables
_deactivate(["nondestructive"])
aliases["deactivate"] = _deactivate
$VIRTUAL_ENV = r"/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env"
$_OLD_VIRTUAL_PATH = $PATH
$PATH = $PATH[:]
$PATH.add($VIRTUAL_ENV + _get_sep() + "bin", front=True, replace=True)
if ${...}.get("PYTHONHOME", ""):
# unset PYTHONHOME if set
$_OLD_VIRTUAL_PYTHONHOME = $PYTHONHOME
del $PYTHONHOME
$VIRTUAL_ENV_PROMPT = ""
if not $VIRTUAL_ENV_PROMPT:
del $VIRTUAL_ENV_PROMPT
aliases["pydoc"] = ["python", "-m", "pydoc"]

46
env/bin/activate_this.py vendored Normal file
View File

@@ -0,0 +1,46 @@
"""Activate virtualenv for current interpreter:
Use exec(open(this_file).read(), {'__file__': this_file}).
This can be used when you must use an existing Python interpreter, not the virtualenv bin/python.
"""
import os
import site
import sys
try:
__file__
except NameError:
raise AssertionError("You must use exec(open(this_file).read(), {'__file__': this_file}))")
# prepend bin to PATH (this file is inside the bin directory)
bin_dir = os.path.dirname(os.path.abspath(__file__))
os.environ["PATH"] = os.pathsep.join([bin_dir] + os.environ.get("PATH", "").split(os.pathsep))
base = os.path.dirname(bin_dir)
# virtual env is right above bin directory
os.environ["VIRTUAL_ENV"] = base
# add the virtual environments site-package to the host python import mechanism
IS_PYPY = hasattr(sys, "pypy_version_info")
IS_JYTHON = sys.platform.startswith("java")
if IS_JYTHON:
site_packages = os.path.join(base, "Lib", "site-packages")
elif IS_PYPY:
site_packages = os.path.join(base, "site-packages")
else:
IS_WIN = sys.platform == "win32"
if IS_WIN:
site_packages = os.path.join(base, "Lib", "site-packages")
else:
site_packages = os.path.join(base, "lib", "python{}.{}".format(*sys.version_info), "site-packages")
prev = set(sys.path)
site.addsitedir(site_packages)
sys.real_prefix = sys.prefix
sys.prefix = base
# Move the added items to the front of the path, in place
new = list(sys.path)
sys.path[:] = [i for i in new if i not in prev] + [i for i in new if i in prev]

10
env/bin/black vendored Executable file
View File

@@ -0,0 +1,10 @@
#!/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys
from black import patched_main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(patched_main())

10
env/bin/blackd vendored Executable file
View File

@@ -0,0 +1,10 @@
#!/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys
from blackd import patched_main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(patched_main())

10
env/bin/easy_install vendored Executable file
View File

@@ -0,0 +1,10 @@
#!/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys
from setuptools.command.easy_install import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())

10
env/bin/easy_install-3.7 vendored Executable file
View File

@@ -0,0 +1,10 @@
#!/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys
from setuptools.command.easy_install import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())

10
env/bin/pip vendored Executable file
View File

@@ -0,0 +1,10 @@
#!/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())

10
env/bin/pip3 vendored Executable file
View File

@@ -0,0 +1,10 @@
#!/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())

10
env/bin/pip3.7 vendored Executable file
View File

@@ -0,0 +1,10 @@
#!/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())

1
env/bin/python vendored Symbolic link
View File

@@ -0,0 +1 @@
python3.7

78
env/bin/python-config vendored Executable file
View File

@@ -0,0 +1,78 @@
#!/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env/bin/python
import sys
import getopt
import sysconfig
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
'ldflags', 'help']
if sys.version_info >= (3, 2):
valid_opts.insert(-1, 'extension-suffix')
valid_opts.append('abiflags')
if sys.version_info >= (3, 3):
valid_opts.append('configdir')
def exit_with_usage(code=1):
sys.stderr.write("Usage: {0} [{1}]\n".format(
sys.argv[0], '|'.join('--'+opt for opt in valid_opts)))
sys.exit(code)
try:
opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
except getopt.error:
exit_with_usage()
if not opts:
exit_with_usage()
pyver = sysconfig.get_config_var('VERSION')
getvar = sysconfig.get_config_var
opt_flags = [flag for (flag, val) in opts]
if '--help' in opt_flags:
exit_with_usage(code=0)
for opt in opt_flags:
if opt == '--prefix':
print(sysconfig.get_config_var('prefix'))
elif opt == '--exec-prefix':
print(sysconfig.get_config_var('exec_prefix'))
elif opt in ('--includes', '--cflags'):
flags = ['-I' + sysconfig.get_path('include'),
'-I' + sysconfig.get_path('platinclude')]
if opt == '--cflags':
flags.extend(getvar('CFLAGS').split())
print(' '.join(flags))
elif opt in ('--libs', '--ldflags'):
abiflags = getattr(sys, 'abiflags', '')
libs = ['-lpython' + pyver + abiflags]
libs += getvar('LIBS').split()
libs += getvar('SYSLIBS').split()
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
# shared library in prefix/lib/.
if opt == '--ldflags':
if not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL'))
if not getvar('PYTHONFRAMEWORK'):
libs.extend(getvar('LINKFORSHARED').split())
print(' '.join(libs))
elif opt == '--extension-suffix':
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
if ext_suffix is None:
ext_suffix = sysconfig.get_config_var('SO')
print(ext_suffix)
elif opt == '--abiflags':
if not getattr(sys, 'abiflags', None):
exit_with_usage()
print(sys.abiflags)
elif opt == '--configdir':
print(sysconfig.get_config_var('LIBPL'))

1
env/bin/python3 vendored Symbolic link
View File

@@ -0,0 +1 @@
python3.7

BIN
env/bin/python3.7 vendored Executable file

Binary file not shown.

10
env/bin/wheel vendored Executable file
View File

@@ -0,0 +1,10 @@
#!/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys
from wheel.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())

1
env/include/python3.7m vendored Symbolic link
View File

@@ -0,0 +1 @@
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m

View File

@@ -50,9 +50,9 @@
"config": {
"contractsPackages": "@0x/contracts-asset-proxy @0x/contracts-erc20 @0x/contracts-erc721 @0x/contracts-erc1155 @0x/contracts-exchange @0x/contracts-exchange-forwarder @0x/contracts-exchange-libs @0x/contracts-extensions @0x/contracts-multisig @0x/contracts-test-utils @0x/contracts-utils @0x/contracts-coordinator @0x/contracts-dev-utils",
"mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic",
"packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper contract-wrappers order-utils order-watcher sol-compiler sol-coverage sol-profiler sol-trace ethereum-types asset-buyer migrations",
"packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper order-utils sol-compiler sol-coverage sol-profiler sol-trace ethereum-types asset-buyer migrations",
"ignoreDependencyVersions": "@types/styled-components @types/node",
"ignoreDependencyVersionsForPackage": "website instant dev-tools-pages"
"ignoreDependencyVersionsForPackage": "website instant dev-tools-pages contract-wrappers"
},
"bundlewatch": {
"files": [
@@ -77,7 +77,7 @@
"graceful-fs": "4.1.15"
},
"devDependencies": {
"@0x-lerna-fork/lerna": "3.16.9",
"@0x-lerna-fork/lerna": "3.16.10",
"@0xproject/npm-cli-login": "^0.0.11",
"async-child-process": "^1.1.1",
"bundlewatch": "^0.2.1",

View File

@@ -1,4 +1,30 @@
[
{
"version": "7.0.0",
"changes": [
{
"note": "Add optional `exchangeAddress` parameter to `signatureUtils.isValidSignatureAsync` to fix `Validator` type signatures.",
"pr": 2017
},
{
"note": "Removed @0x/order-watcher"
},
{
"note": "Update to latest @0x/contract-wrappers v11",
"pr": 2068
}
],
"timestamp": 1566446343
},
{
"timestamp": 1565296576,
"version": "6.0.15",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1564604963,
"version": "6.0.14",

View File

@@ -5,6 +5,16 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v7.0.0 - _August 22, 2019_
* Add optional `exchangeAddress` parameter to `signatureUtils.isValidSignatureAsync` to fix `Validator` type signatures. (#2017)
* Removed @0x/order-watcher
* Update to latest @0x/contract-wrappers v11 (#2068)
## v6.0.15 - _August 8, 2019_
* Dependencies updated
## v6.0.14 - _July 31, 2019_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
## 0x.js
A TypeScript/Javascript library for interacting with the 0x protocol. It is a high level package which combines a number of underlying packages such as order-utils and order-watcher.
A TypeScript/Javascript library for interacting with the 0x protocol. It is a high level package which combines a number of underlying packages such as order-utils and asset-data-utils.
### Read the [Documentation](https://0xproject.com/docs/0x.js).

View File

@@ -1,6 +1,6 @@
{
"name": "0x.js",
"version": "6.0.14",
"version": "7.0.0",
"engines": {
"node": ">=6.12"
},
@@ -43,10 +43,9 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@0x/abi-gen-wrappers": "^5.1.0",
"@0x/contract-addresses": "^3.0.2",
"@0x/dev-utils": "^2.2.6",
"@0x/migrations": "^4.1.11",
"@0x/contract-addresses": "^3.1.0",
"@0x/dev-utils": "^2.3.1",
"@0x/migrations": "^4.3.0",
"@0x/tslint-config": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
@@ -73,17 +72,16 @@
"webpack": "^4.20.2"
},
"dependencies": {
"@0x/assert": "^2.1.2",
"@0x/asset-swapper": "^1.0.0",
"@0x/base-contract": "^5.3.0",
"@0x/contract-wrappers": "^10.1.0",
"@0x/order-utils": "^8.2.4",
"@0x/order-watcher": "^4.0.16",
"@0x/subproviders": "^5.0.0",
"@0x/assert": "^2.1.4",
"@0x/asset-swapper": "^1.0.2",
"@0x/base-contract": "^5.3.2",
"@0x/contract-wrappers": "^11.1.0",
"@0x/order-utils": "^8.3.0",
"@0x/subproviders": "^5.0.2",
"@0x/types": "^2.4.1",
"@0x/typescript-typings": "^4.2.4",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"@types/web3-provider-engine": "^14.0.0",
"ethereum-types": "^2.1.4",
"ethers": "~4.0.4",

View File

@@ -13,33 +13,23 @@ export {
CoordinatorWrapper,
CoordinatorServerCancellationResponse,
CoordinatorServerError,
DutchAuctionWrapper,
ERC20TokenWrapper,
ERC721TokenWrapper,
EtherTokenWrapper,
ExchangeWrapper,
ERC20ProxyWrapper,
ERC721ProxyWrapper,
ForwarderWrapper,
OrderValidatorWrapper,
IndexedFilterValues,
BlockRange,
ContractWrappersConfig,
MethodOpts,
OrderTransactionOpts,
TransactionOpts,
OrderStatus,
OrderInfo,
EventCallback,
DecodedLogEvent,
TransactionEncoder,
BalanceAndAllowance,
OrderAndTraderInfo,
TraderInfo,
ValidateOrderFillableOpts,
} from '@0x/contract-wrappers';
export {
OrderStatus,
DutchAuctionContract,
ERC20ProxyContract,
ERC20TokenContract,
ERC721ProxyContract,
ERC721TokenContract,
ExchangeContract,
ForwarderContract,
OrderValidatorContract,
WETH9Contract,
WETH9Events,
WETH9WithdrawalEventArgs,
WETH9ApprovalEventArgs,
@@ -62,9 +52,7 @@ export {
ExchangeCancelEventArgs,
ExchangeEventArgs,
ExchangeEvents,
} from '@0x/abi-gen-wrappers';
export { OrderWatcher, OnOrderStateChangeCallback, OrderWatcherConfig } from '@0x/order-watcher';
} from '@0x/contract-wrappers';
export import Web3ProviderEngine = require('web3-provider-engine');
@@ -81,14 +69,10 @@ export { AbiDecoder, DecodedCalldata } from '@0x/utils';
export { BigNumber } from '@0x/utils';
export {
ExchangeContractErrs,
Order,
SignedOrder,
DutchAuctionData,
ECSignature,
OrderStateValid,
OrderStateInvalid,
OrderState,
AssetProxyId,
AssetData,
SingleAssetData,
@@ -99,18 +83,13 @@ export {
MultiAssetDataWithRecursiveDecoding,
StaticCallAssetData,
SignatureType,
ObjectMap,
OrderRelevantState,
Stats,
DutchAuctionDetails,
ZeroExTransaction,
SignedZeroExTransaction,
ValidatorSignature,
} from '@0x/types';
export {
BlockParamLiteral,
ContractAbi,
BlockParam,
LogWithDecodedArgs,
ContractEventArg,
SupportedProvider,

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1566446343,
"version": "2.4.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1565296576,
"version": "2.4.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "2.4.0",
"changes": [

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v2.4.2 - _August 22, 2019_
* Dependencies updated
## v2.4.1 - _August 8, 2019_
* Dependencies updated
## v2.4.0 - _July 31, 2019_
* Updated interface to `deployFrom0xArtifactAsync` to include log decode dependencies. (#1995)

View File

@@ -11,37 +11,18 @@ from typing import ( # pylint: disable=unused-import
Union,
)
from eth_utils import to_checksum_address
from mypy_extensions import TypedDict # pylint: disable=unused-import
from hexbytes import HexBytes
from web3 import Web3
from web3.contract import ContractFunction
from web3.datastructures import AttributeDict
from web3.providers.base import BaseProvider
from zero_ex.contract_wrappers._base_contract_wrapper import BaseContractWrapper
from zero_ex.contract_wrappers.bases import ContractMethod, Validator
from zero_ex.contract_wrappers.tx_params import TxParams
class {{contractName}}ValidatorBase:
"""Base class for validating inputs to {{contractName}} methods."""
def __init__(
self,
provider: BaseProvider,
contract_address: str,
private_key: str = None,
):
"""Initialize the instance."""
def assert_valid(
self, method_name: str, parameter_name: str, argument_value: Any
):
"""Raise an exception if method input is not valid.
:param method_name: Name of the method whose input is to be validated.
:param parameter_name: Name of the parameter whose input is to be
validated.
:param argument_value: Value of argument to parameter to be validated.
"""
# Try to import a custom validator class definition; if there isn't one,
# declare one that we can instantiate for the default argument to the
# constructor for {{contractName}} below.
@@ -53,56 +34,60 @@ try:
)
except ImportError:
class {{contractName}}Validator({{contractName}}ValidatorBase): # type: ignore
class {{contractName}}Validator( # type: ignore
Validator
):
"""No-op input validator."""
{{tupleDefinitions ABIString}}
{{#each methods}}
{{> method_class contractName=../contractName}}
{{/each}}
# pylint: disable=too-many-public-methods
class {{contractName}}(BaseContractWrapper):
# pylint: disable=too-many-public-methods,too-many-instance-attributes
class {{contractName}}:
"""Wrapper class for {{contractName}} Solidity contract.{{docBytesIfNecessary ABIString}}"""
{{#each methods}}
{{toPythonIdentifier this.languageSpecificName}}: {{toPythonClassname this.languageSpecificName}}Method
"""Constructor-initialized instance of
:class:`{{toPythonClassname this.languageSpecificName}}Method`.
"""
{{/each}}
def __init__(
self,
provider: BaseProvider,
contract_address: str,
validator: {{contractName}}Validator = None,
private_key: str = None,
):
"""Get an instance of wrapper for smart contract.
:param provider: instance of :class:`web3.providers.base.BaseProvider`
:param contract_address: where the contract has been deployed
:param private_key: If specified, transactions will be signed locally,
via Web3.py's `eth.account.signTransaction()`:code:, before being
sent via `eth.sendRawTransaction()`:code:.
:param validator: for validation of method inputs.
"""
super().__init__(
provider=provider,
contract_address=contract_address,
private_key=private_key,
)
self.contract_address = contract_address
if not validator:
validator = {{contractName}}Validator(provider, contract_address, private_key)
validator = {{contractName}}Validator(provider, contract_address)
self.validator = validator
self._web3_eth = Web3( # type: ignore # pylint: disable=no-member
provider
).eth
def _get_contract_instance(self, token_address):
"""Get an instance of the smart contract at a specific address.
{{#if methods}}
functions = self._web3_eth.contract(address=to_checksum_address(contract_address), abi={{contractName}}.abi()).functions
:returns: contract object
"""
return self._contract_instance(
address=token_address, abi={{contractName}}.abi()
)
{{#each methods}}
{{> call contractName=../contractName}}
{{/each}}
{{#each methods}}
self.{{toPythonIdentifier this.languageSpecificName}} = {{toPythonClassname this.languageSpecificName}}Method(provider, contract_address, functions.{{this.name}}, validator)
{{/each}}
{{/if}}
{{#each events}}
{{> event}}
{{> event contractName=../contractName}}
{{/each}}
@staticmethod

View File

@@ -1,54 +0,0 @@
def {{this.languageSpecificName}}(
self,
{{> typed_params inputs=inputs}}
tx_params: Optional[TxParams] = None,
{{^this.constant}}
view_only: bool = False,
{{/this.constant}}
) -> {{> return_type outputs=outputs~}}:
"""Execute underlying, same-named contract method.
{{sanitizeDevdocDetails this.name this.devdoc.details 8}}{{~#if this.devdoc.params~}}{{#each this.devdoc.params}}
{{makeParameterDocstringRole @key this 8}}{{/each}}{{/if}}
:param tx_params: transaction parameters
{{#if this.constant~}}
{{#if this.devdoc.return}}
{{makeReturnDocstringRole this.devdoc.return 8}}{{/if}}
{{else}}
:param view_only: whether to use transact() or call()
:returns: if param `view_only`:code: is `True`:code:, then returns the
value returned from the underlying function; else returns the
transaction hash.
{{/if}}
"""
{{#each this.inputs}}
self.validator.assert_valid(
method_name='{{../name}}',
parameter_name='{{name}}',
argument_value={{toPythonIdentifier name}},
)
{{#if (equal type 'address')}}
{{toPythonIdentifier this.name}} = self._validate_and_checksum_address({{toPythonIdentifier this.name}})
{{else if (equal type 'uint256')}}
# safeguard against fractional inputs
{{toPythonIdentifier this.name}} = int({{toPythonIdentifier this.name}})
{{else if (equal type 'bytes')}}
{{toPythonIdentifier this.name}} = bytes.fromhex({{toPythonIdentifier this.name}}.decode("utf-8"))
{{else if (equal type 'bytes[]')}}
{{toPythonIdentifier this.name}} = [
bytes.fromhex({{toPythonIdentifier this.name}}_element.decode("utf-8"))
for {{toPythonIdentifier this.name}}_element in {{toPythonIdentifier this.name}}
]
{{/if}}
{{/each}}
func = self._get_contract_instance(
self.contract_address
).functions.{{this.name}}(
{{> params}}
)
return self._invoke_function_call(
func=func,
tx_params=tx_params,
view_only={{#if this.constant}}True{{else}}view_only{{/if}}
)

View File

@@ -6,8 +6,4 @@
{{makeEventParameterDocstringRole name 8}}
"""
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return (
self._get_contract_instance(self.contract_address)
.events.{{name}}()
.processReceipt(tx_receipt)
)
return self._web3_eth.contract(address=to_checksum_address(self.contract_address), abi={{contractName}}.abi()).events.{{name}}().processReceipt(tx_receipt)

View File

@@ -0,0 +1,76 @@
class {{toPythonClassname this.languageSpecificName}}Method(ContractMethod):
"""Various interfaces to the {{this.name}} method."""
def __init__(self, provider: BaseProvider, contract_address: str, contract_function: ContractFunction, validator: Validator=None):
"""Persist instance data."""
super().__init__(provider, contract_address, validator)
self.underlying_method = contract_function
{{#if inputs}}
def validate_and_normalize_inputs(self, {{> typed_params inputs=inputs}}):
"""Validate the inputs to the {{this.name}} method."""
{{#each this.inputs}}
self.validator.assert_valid(
method_name='{{../name}}',
parameter_name='{{name}}',
argument_value={{toPythonIdentifier name}},
)
{{#if (equal type 'address')}}
{{toPythonIdentifier this.name}} = self.validate_and_checksum_address({{toPythonIdentifier this.name}})
{{else if (equal type 'uint256')}}
# safeguard against fractional inputs
{{toPythonIdentifier this.name}} = int({{toPythonIdentifier this.name}})
{{else if (equal type 'bytes')}}
{{toPythonIdentifier this.name}} = bytes.fromhex({{toPythonIdentifier this.name}}.decode("utf-8"))
{{else if (equal type 'bytes[]')}}
{{toPythonIdentifier this.name}} = [
bytes.fromhex({{toPythonIdentifier this.name}}_element.decode("utf-8"))
for {{toPythonIdentifier this.name}}_element in {{toPythonIdentifier this.name}}
]
{{/if}}
{{/each}}
return ({{> params }})
{{/if}}
def call(self, {{#if inputs}}{{> typed_params inputs=inputs}}, {{/if}}tx_params: Optional[TxParams] = None) -> {{> return_type outputs=outputs type='call'~}}:
"""Execute underlying contract method via eth_call.
{{sanitizeDevdocDetails this.name this.devdoc.details 8}}{{~#if this.devdoc.params~}}{{#each this.devdoc.params}}
{{makeParameterDocstringRole @key this 8}}{{/each}}{{/if}}
:param tx_params: transaction parameters
{{#if this.constant~}}
{{#if this.devdoc.return}}
{{makeReturnDocstringRole this.devdoc.return 8}}{{/if}}
{{else}}
:returns: the return value of the underlying method.
{{/if}}
"""
{{#if inputs}}
({{> params }}) = self.validate_and_normalize_inputs({{> params}})
{{/if}}
tx_params = super().normalize_tx_params(tx_params)
return self.underlying_method({{> params}}).call(tx_params.as_dict())
def send_transaction(self, {{#if inputs}}{{> typed_params inputs=inputs}}, {{/if}}tx_params: Optional[TxParams] = None) -> Union[HexBytes, bytes]:
"""Execute underlying contract method via eth_sendTransaction.
{{sanitizeDevdocDetails this.name this.devdoc.details 8}}{{~#if this.devdoc.params~}}{{#each this.devdoc.params}}
{{makeParameterDocstringRole @key this 8}}{{/each}}{{/if}}
:param tx_params: transaction parameters
{{#if this.constant~}}
{{#if this.devdoc.return}}
{{makeReturnDocstringRole this.devdoc.return 8}}{{/if}}
{{/if}}
"""
{{#if inputs}}
({{> params }}) = self.validate_and_normalize_inputs({{> params}})
{{/if}}
tx_params = super().normalize_tx_params(tx_params)
return self.underlying_method({{> params}}).transact(tx_params.as_dict())
def estimate_gas(self, {{#if inputs}}{{> typed_params inputs=inputs}}, {{/if}}tx_params: Optional[TxParams] = None) -> int:
"""Estimate gas consumption of method call."""
{{#if inputs}}
({{> params }}) = self.validate_and_normalize_inputs({{> params}})
{{/if}}
tx_params = super().normalize_tx_params(tx_params)
return self.underlying_method({{> params}}).estimateGas(tx_params.as_dict())

View File

@@ -1,3 +1,3 @@
{{#each inputs}}
{{toPythonIdentifier name}}{{#if @last}}{{else}},{{/if}}
{{/each}}
{{toPythonIdentifier name}}{{#if @last}}{{else}}, {{/if~}}
{{/each~}}

View File

@@ -7,8 +7,8 @@ Union[
{{#returnType outputs.0.type outputs.0.components}}{{~/returnType~}}
{{/singleReturnValue}}
{{^singleReturnValue}}
[{{#each outputs}}{{#returnType type components}}{{/returnType}}{{#unless @last}}, {{/unless}}{{/each}}]
{{/singleReturnValue}}
Tuple[{{#each outputs}}{{#returnType type components}}{{/returnType}}{{#unless @last}}, {{/unless}}{{/each}}]
{{~/singleReturnValue}}
{{else}}None
{{/if}}{{^if this.constant}}, Union[HexBytes, bytes]]{{/if~}}
{{else}}{{#if this.constant}}None{{else}}Union[None, Union[HexBytes, bytes]]{{/if}}{{/if~}}

View File

@@ -1,3 +1,3 @@
{{#each inputs}}
{{toPythonIdentifier name}}: {{#parameterType type components}}{{/parameterType}},
{{/each}}
{{toPythonIdentifier name}}: {{#parameterType type components}}{{/parameterType}}{{^if @last}}, {{/if~}}
{{/each~}}

View File

@@ -51,6 +51,11 @@ export enum {{contractName}}Events {
// tslint:disable-next-line:class-name
export class {{contractName}}Contract extends BaseContract {
{{#each methods}}
{{#if this.devdoc.details}}
/**
* {{formatDocstringForMethodTs this.devdoc.details}}
*/
{{/if}}
{{#this.constant}}
{{> call contractName=../contractName}}
{{/this.constant}}
@@ -78,8 +83,10 @@ export class {{contractName}}Contract extends BaseContract {
const bytecode = artifact.compilerOutput.evm.bytecode.object;
const abi = artifact.compilerOutput.abi;
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
for (const key of Object.keys(logDecodeDependencies)) {
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
if (Object.keys(logDecodeDependencies) !== undefined) {
for (const key of Object.keys(logDecodeDependencies)) {
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
}
}
return {{contractName}}Contract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly, {{> params inputs=ctor.inputs}});
}
@@ -153,11 +160,11 @@ export class {{contractName}}Contract extends BaseContract {
}{{#if events}}
/**
* Subscribe to an event type emitted by the {{contractName}} contract.
* @param eventName The {{contractName}} contract event you would like to subscribe to.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{maker: aUserAddressHex}`
* @param callback Callback that gets called when a log is added/removed
* @param isVerbose Enable verbose subscription warnings (e.g recoverable network issues encountered)
* @param eventName The {{contractName}} contract event you would like to subscribe to.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{maker: aUserAddressHex}`
* @param callback Callback that gets called when a log is added/removed
* @param isVerbose Enable verbose subscription warnings (e.g recoverable network issues encountered)
* @return Subscription token used later to unsubscribe
*/
public subscribe<ArgsType extends {{contractName}}EventArgs>(
@@ -183,7 +190,7 @@ export class {{contractName}}Contract extends BaseContract {
}
/**
* Cancel a subscription
* @param subscriptionToken Subscription token returned by `subscribe()`
* @param subscriptionToken Subscription token returned by `subscribe()`
*/
public unsubscribe(subscriptionToken: string): void {
this._subscriptionManager.unsubscribe(subscriptionToken);
@@ -196,11 +203,11 @@ export class {{contractName}}Contract extends BaseContract {
}
/**
* Gets historical logs without creating a subscription
* @param eventName The {{contractName}} contract event you would like to subscribe to.
* @param blockRange Block range to get logs from.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{_from: aUserAddressHex}`
* @return Array of logs that match the parameters
* @param eventName The {{contractName}} contract event you would like to subscribe to.
* @param blockRange Block range to get logs from.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{_from: aUserAddressHex}`
* @return Array of logs that match the parameters
*/
public async getLogsAsync<ArgsType extends {{contractName}}EventArgs>(
eventName: {{contractName}}Events,

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/abi-gen-templates",
"version": "2.4.0",
"version": "2.4.2",
"engines": {
"node": ">=6.12"
},

View File

@@ -1,3 +1,12 @@
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
{{> params_docstring inputs=inputs docstrings=devdoc.params}}
{{#if devdoc.return}}
* @returns {{devdoc.return}}
{{/if}}
*/
async callAsync(
{{> typed_params inputs=inputs}}
callData: Partial<CallData> = {},
@@ -34,6 +43,12 @@ async callAsync(
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
{{> params_docstring inputs=inputs docstrings=devdoc.params}}
*/
getABIEncodedTransactionData(
{{> typed_params inputs=inputs}}
): string {
@@ -44,3 +59,21 @@ getABIEncodedTransactionData(
const abiEncodedTransactionData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> normalized_params inputs=inputs}}]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(
callData: string
): ({{> return_type inputs=inputs ~}}) {
const self = this as any as {{contractName}}Contract;
const abiEncoder = self._lookupAbiEncoder('{{this.functionSignature}}');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<{{> return_type inputs=inputs}}>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(
returnData: string
): ({{> return_type outputs=outputs ~}}) {
const self = this as any as {{contractName}}Contract;
const abiEncoder = self._lookupAbiEncoder('{{this.functionSignature}}');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<{{> return_type outputs=outputs}}>(returnData);
return abiDecodedReturnData;
},

View File

@@ -0,0 +1,5 @@
{{#each inputs}}
{{#if (getDocstringForParamTs name ../docstrings)}}
{{formatDocstringForParamTs name (getDocstringForParamTs name ../docstrings)}}
{{/if}}
{{/each}}

View File

@@ -1,4 +1,11 @@
public {{languageSpecificName}} = {
/**
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
* Ethereum operation and will cost gas.
{{> params_docstring inputs=inputs docstrings=devdoc.params}}
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async sendTransactionAsync(
{{> typed_params inputs=inputs}}
txData?: Partial<TxData> | undefined,
@@ -27,6 +34,14 @@ public {{languageSpecificName}} = {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
/**
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
* If the transaction was mined, but reverted, an error is thrown.
{{> params_docstring inputs=inputs docstrings=devdoc.params}}
* @param txData Additional data for transaction
* @param pollingIntervalMs Interval at which to poll for success
* @returns A promise that resolves when the transaction is successful
*/
awaitTransactionSuccessAsync(
{{> typed_params inputs=inputs}}
txData?: Partial<TxData>,
@@ -54,6 +69,12 @@ public {{languageSpecificName}} = {
})(),
);
},
/**
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
{{> params_docstring inputs=inputs docstrings=devdoc.params}}
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async estimateGasAsync(
{{> typed_params inputs=inputs}}
txData?: Partial<TxData> | undefined,
@@ -79,4 +100,22 @@ public {{languageSpecificName}} = {
return gas;
},
{{> callAsync}}
async validateAndSendTransactionAsync(
{{> typed_params inputs=inputs}}
txData?: Partial<TxData> | undefined,
): Promise<string> {
await (this as any).{{languageSpecificName}}.callAsync(
{{#each inputs~}}
{{name}},
{{/each~}}
txData,
);
const txHash = await (this as any).{{languageSpecificName}}.sendTransactionAsync(
{{#each inputs~}}
{{name}},
{{/each~}}
txData,
);
return txHash;
}
};

View File

@@ -1,4 +1,24 @@
[
{
"version": "5.3.0",
"changes": [
{
"note": "Added DevUtils",
"pr": 2060
}
],
"timestamp": 1566446343
},
{
"version": "5.2.0",
"changes": [
{
"note": "Updated to include `getABIDecodedTransactionData` and `getABIDecodedReturnData`",
"pr": 2018
}
],
"timestamp": 1565296576
},
{
"version": "5.1.0",
"changes": [

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v5.3.0 - _August 22, 2019_
* Added DevUtils (#2060)
## v5.2.0 - _August 8, 2019_
* Updated to include `getABIDecodedTransactionData` and `getABIDecodedReturnData` (#2018)
## v5.1.0 - _July 31, 2019_
* Add subscribe/unsubscribe methods for events (#1970)

View File

@@ -71,3 +71,9 @@ yarn lint
```bash
yarn test
```
### Documentation
Documentation for this package is generated by TypeDoc, using the Solidity source code for 0x contracts. Each contract corresponds to one global-level module, which contains relevant enums and interfaces for its events and structs. Most significantly, each module exports a class, `<ContractName>Contract`, e.g. `ExchangeContract`, which implements helper methods for all the functions defined in the corresponding contract.
A convention to note is that these contract-specific helper methods are defined as _object literals_, which are separated from methods in the generated documentation. Each contract method has a number of sub-methods, e.g. `sendTransactionAsync`, or `estimateGasAsync`, which are documented separately. This is an example of an expected method call signature: `exchangeContractInstance.fillOrder.sendTransactionAsync(...arguments)`.

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/abi-gen-wrappers",
"version": "5.1.0",
"version": "5.3.0",
"engines": {
"node": ">=6.12"
},
@@ -10,7 +10,7 @@
"test": "test"
},
"scripts": {
"build": "yarn pre_build && tsc -b",
"build": "yarn pre_build && tsc -b && yarn docs",
"build:ci": "yarn build",
"lint": "tslint --format stylish --project .",
"fix": "tslint --fix --format stylish --project .",
@@ -18,10 +18,11 @@
"prettier": "prettier --write src/**/* --config ../../.prettierrc",
"prettier_contract_wrappers": "prettier --write src/generated-wrappers/* --config ../../.prettierrc",
"clean": "shx rm -rf lib src/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 src/generated-wrappers --backend ethers"
"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 src/generated-wrappers --backend ethers",
"docs": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --out generated_docs ./src/generated-wrappers/*"
},
"config": {
"abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DutchAuction|DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IAssetProxy|IValidator|IWallet|MultiAssetProxy|OrderValidator|WETH9|ZRXToken|Coordinator|CoordinatorRegistry|EthBalanceChecker).json"
"abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DevUtils|DutchAuction|DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IAssetProxy|IValidator|IWallet|MultiAssetProxy|OrderValidator|WETH9|ZRXToken|Coordinator|CoordinatorRegistry|EthBalanceChecker|ERC1155Proxy|StaticCallProxy).json"
},
"repository": {
"type": "git",
@@ -33,23 +34,23 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/abi-gen-templates": "^2.4.0",
"@0x/assert": "^2.1.2",
"@0x/json-schemas": "^3.1.12",
"@0x/abi-gen": "^4.1.1",
"@0x/abi-gen-templates": "^2.4.2",
"@0x/assert": "^2.1.4",
"@0x/json-schemas": "^4.0.0",
"@0x/tslint-config": "^3.0.1",
"@0x/types": "^2.4.1",
"@0x/utils": "^4.4.2",
"@0x/web3-wrapper": "^6.0.9",
"@0x/utils": "^4.5.0",
"@0x/web3-wrapper": "^6.0.11",
"ethereum-types": "^2.1.4",
"ethers": "~4.0.4",
"lodash": "^4.17.11",
"shx": "^0.2.2"
},
"dependencies": {
"@0x/base-contract": "^5.3.0",
"@0x/contract-addresses": "^3.0.2",
"@0x/contract-artifacts": "^2.0.3"
"@0x/base-contract": "^5.3.2",
"@0x/contract-addresses": "^3.1.0",
"@0x/contract-artifacts": "^2.2.0"
},
"publishConfig": {
"access": "public"

File diff suppressed because it is too large Load Diff

View File

@@ -27,7 +27,17 @@ import * as ethers from 'ethers';
// tslint:disable:no-parameter-reassignment
// tslint:disable-next-line:class-name
export class CoordinatorContract extends BaseContract {
/**
* Recovers the address of a signer given a hash and signature.
*/
public getSignerAddress = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param hash Any 32 byte hash.
* @param signature Proof that the hash has been signed by signer.
*/
async callAsync(
hash: string,
signature: string,
@@ -66,6 +76,13 @@ export class CoordinatorContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param hash Any 32 byte hash.
* @param signature Proof that the hash has been signed by signer.
*/
getABIEncodedTransactionData(hash: string, signature: string): string {
assert.isString('hash', hash);
assert.isString('signature', signature);
@@ -76,8 +93,32 @@ export class CoordinatorContract extends BaseContract {
]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): string {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder('getSignerAddress(bytes32,bytes)');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): string {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder('getSignerAddress(bytes32,bytes)');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
return abiDecodedReturnData;
},
};
/**
* Calculates the EIP712 hash of a 0x transaction using the domain separator of the Exchange contract.
*/
public getTransactionHash = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param transaction 0x transaction containing salt, signerAddress, and data.
* @returns EIP712 hash of the transaction with the domain separator of this contract.
*/
async callAsync(
transaction: { salt: BigNumber; signerAddress: string; data: string },
callData: Partial<CallData> = {},
@@ -115,6 +156,12 @@ export class CoordinatorContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param transaction 0x transaction containing salt, signerAddress, and data.
*/
getABIEncodedTransactionData(transaction: { salt: BigNumber; signerAddress: string; data: string }): string {
const self = (this as any) as CoordinatorContract;
const abiEncodedTransactionData = self._strictEncodeArguments(
@@ -123,8 +170,33 @@ export class CoordinatorContract extends BaseContract {
);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): string {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder('getTransactionHash((uint256,address,bytes))');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): string {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder('getTransactionHash((uint256,address,bytes))');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
return abiDecodedReturnData;
},
};
/**
* Calculated the EIP712 hash of the Coordinator approval mesasage using the domain separator of this contract.
*/
public getCoordinatorApprovalHash = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param approval Coordinator approval message containing the transaction
* hash, transaction signature, and expiration of the approval.
* @returns EIP712 hash of the Coordinator approval message with the domain separator of this contract.
*/
async callAsync(
approval: {
txOrigin: string;
@@ -168,6 +240,13 @@ export class CoordinatorContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param approval Coordinator approval message containing the transaction
* hash, transaction signature, and expiration of the approval.
*/
getABIEncodedTransactionData(approval: {
txOrigin: string;
transactionHash: string;
@@ -181,8 +260,40 @@ export class CoordinatorContract extends BaseContract {
);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): string {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder('getCoordinatorApprovalHash((address,bytes32,bytes,uint256))');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): string {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder('getCoordinatorApprovalHash((address,bytes32,bytes,uint256))');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
return abiDecodedReturnData;
},
};
/**
* Executes a 0x transaction that has been signed by the feeRecipients that correspond to each order in the transaction's Exchange calldata.
*/
public executeTransaction = {
/**
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
* Ethereum operation and will cost gas.
* @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.
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async sendTransactionAsync(
transaction: { salt: BigNumber; signerAddress: string; data: string },
txOrigin: string,
@@ -229,6 +340,22 @@ export class CoordinatorContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
/**
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
* If the transaction was mined, but reverted, an error is thrown.
* @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.
* @param txData Additional data for transaction
* @param pollingIntervalMs Interval at which to poll for success
* @returns A promise that resolves when the transaction is successful
*/
awaitTransactionSuccessAsync(
transaction: { salt: BigNumber; signerAddress: string; data: string },
txOrigin: string,
@@ -264,6 +391,20 @@ export class CoordinatorContract extends BaseContract {
})(),
);
},
/**
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
* @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.
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async estimateGasAsync(
transaction: { salt: BigNumber; signerAddress: string; data: string },
txOrigin: string,
@@ -302,6 +443,20 @@ export class CoordinatorContract extends BaseContract {
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
return gas;
},
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @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.
*/
async callAsync(
transaction: { salt: BigNumber; signerAddress: string; data: string },
txOrigin: string,
@@ -356,6 +511,20 @@ export class CoordinatorContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @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.
*/
getABIEncodedTransactionData(
transaction: { salt: BigNumber; signerAddress: string; data: string },
txOrigin: string,
@@ -380,8 +549,57 @@ export class CoordinatorContract extends BaseContract {
);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): void {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder(
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
);
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): void {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder(
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
);
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
return abiDecodedReturnData;
},
async validateAndSendTransactionAsync(
transaction: { salt: BigNumber; signerAddress: string; data: string },
txOrigin: string,
transactionSignature: string,
approvalExpirationTimeSeconds: BigNumber[],
approvalSignatures: string[],
txData?: Partial<TxData> | undefined,
): Promise<string> {
await (this as any).executeTransaction.callAsync(
transaction,
txOrigin,
transactionSignature,
approvalExpirationTimeSeconds,
approvalSignatures,
txData,
);
const txHash = await (this as any).executeTransaction.sendTransactionAsync(
transaction,
txOrigin,
transactionSignature,
approvalExpirationTimeSeconds,
approvalSignatures,
txData,
);
return txHash;
},
};
public EIP712_EXCHANGE_DOMAIN_HASH = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
*/
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
schemas.addressSchema,
@@ -413,13 +631,50 @@ export class CoordinatorContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
*/
getABIEncodedTransactionData(): string {
const self = (this as any) as CoordinatorContract;
const abiEncodedTransactionData = self._strictEncodeArguments('EIP712_EXCHANGE_DOMAIN_HASH()', []);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): string {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder('EIP712_EXCHANGE_DOMAIN_HASH()');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): string {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder('EIP712_EXCHANGE_DOMAIN_HASH()');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
return abiDecodedReturnData;
},
};
/**
* Validates that the 0x transaction has been approved by all of the feeRecipients
* that correspond to each order in the transaction's Exchange calldata.
*/
public assertValidCoordinatorApprovals = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @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.
*/
async callAsync(
transaction: { salt: BigNumber; signerAddress: string; data: string },
txOrigin: string,
@@ -474,6 +729,20 @@ export class CoordinatorContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @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.
*/
getABIEncodedTransactionData(
transaction: { salt: BigNumber; signerAddress: string; data: string },
txOrigin: string,
@@ -498,8 +767,36 @@ export class CoordinatorContract extends BaseContract {
);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): void {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder(
'assertValidCoordinatorApprovals((uint256,address,bytes),address,bytes,uint256[],bytes[])',
);
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): void {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder(
'assertValidCoordinatorApprovals((uint256,address,bytes),address,bytes,uint256[],bytes[])',
);
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
return abiDecodedReturnData;
},
};
/**
* Decodes the orders from Exchange calldata representing any fill method.
*/
public decodeOrdersFromFillData = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param data Exchange calldata representing a fill method.
* @returns The orders from the Exchange calldata.
*/
async callAsync(
data: string,
callData: Partial<CallData> = {},
@@ -566,14 +863,99 @@ export class CoordinatorContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param data Exchange calldata representing a fill method.
*/
getABIEncodedTransactionData(data: string): string {
assert.isString('data', data);
const self = (this as any) as CoordinatorContract;
const abiEncodedTransactionData = self._strictEncodeArguments('decodeOrdersFromFillData(bytes)', [data]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(
callData: string,
): Array<{
makerAddress: string;
takerAddress: string;
feeRecipientAddress: string;
senderAddress: string;
makerAssetAmount: BigNumber;
takerAssetAmount: BigNumber;
makerFee: BigNumber;
takerFee: BigNumber;
expirationTimeSeconds: BigNumber;
salt: BigNumber;
makerAssetData: string;
takerAssetData: string;
}> {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder('decodeOrdersFromFillData(bytes)');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<
Array<{
makerAddress: string;
takerAddress: string;
feeRecipientAddress: string;
senderAddress: string;
makerAssetAmount: BigNumber;
takerAssetAmount: BigNumber;
makerFee: BigNumber;
takerFee: BigNumber;
expirationTimeSeconds: BigNumber;
salt: BigNumber;
makerAssetData: string;
takerAssetData: string;
}>
>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(
returnData: string,
): Array<{
makerAddress: string;
takerAddress: string;
feeRecipientAddress: string;
senderAddress: string;
makerAssetAmount: BigNumber;
takerAssetAmount: BigNumber;
makerFee: BigNumber;
takerFee: BigNumber;
expirationTimeSeconds: BigNumber;
salt: BigNumber;
makerAssetData: string;
takerAssetData: string;
}> {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder('decodeOrdersFromFillData(bytes)');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<
Array<{
makerAddress: string;
takerAddress: string;
feeRecipientAddress: string;
senderAddress: string;
makerAssetAmount: BigNumber;
takerAssetAmount: BigNumber;
makerFee: BigNumber;
takerFee: BigNumber;
expirationTimeSeconds: BigNumber;
salt: BigNumber;
makerAssetData: string;
takerAssetData: string;
}>
>(returnData);
return abiDecodedReturnData;
},
};
public EIP712_COORDINATOR_DOMAIN_HASH = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
*/
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
schemas.addressSchema,
@@ -605,11 +987,30 @@ export class CoordinatorContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
*/
getABIEncodedTransactionData(): string {
const self = (this as any) as CoordinatorContract;
const abiEncodedTransactionData = self._strictEncodeArguments('EIP712_COORDINATOR_DOMAIN_HASH()', []);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): string {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder('EIP712_COORDINATOR_DOMAIN_HASH()');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): string {
const self = (this as any) as CoordinatorContract;
const abiEncoder = self._lookupAbiEncoder('EIP712_COORDINATOR_DOMAIN_HASH()');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
return abiDecodedReturnData;
},
};
public static async deployFrom0xArtifactAsync(
artifact: ContractArtifact | SimpleContractArtifact,
@@ -630,8 +1031,10 @@ export class CoordinatorContract extends BaseContract {
const bytecode = artifact.compilerOutput.evm.bytecode.object;
const abi = artifact.compilerOutput.abi;
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
for (const key of Object.keys(logDecodeDependencies)) {
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
if (Object.keys(logDecodeDependencies) !== undefined) {
for (const key of Object.keys(logDecodeDependencies)) {
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
}
}
return CoordinatorContract.deployAsync(
bytecode,

View File

@@ -46,7 +46,17 @@ export interface CoordinatorRegistryCoordinatorEndpointSetEventArgs extends Deco
// tslint:disable:no-parameter-reassignment
// tslint:disable-next-line:class-name
export class CoordinatorRegistryContract extends BaseContract {
/**
* Called by a Coordinator operator to set the endpoint of their Coordinator.
*/
public setCoordinatorEndpoint = {
/**
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
* Ethereum operation and will cost gas.
* @param coordinatorEndpoint endpoint of the Coordinator.
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async sendTransactionAsync(coordinatorEndpoint: string, txData?: Partial<TxData> | undefined): Promise<string> {
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
const self = (this as any) as CoordinatorRegistryContract;
@@ -67,6 +77,14 @@ export class CoordinatorRegistryContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
/**
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
* If the transaction was mined, but reverted, an error is thrown.
* @param coordinatorEndpoint endpoint of the Coordinator.
* @param txData Additional data for transaction
* @param pollingIntervalMs Interval at which to poll for success
* @returns A promise that resolves when the transaction is successful
*/
awaitTransactionSuccessAsync(
coordinatorEndpoint: string,
txData?: Partial<TxData>,
@@ -88,6 +106,12 @@ export class CoordinatorRegistryContract extends BaseContract {
})(),
);
},
/**
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
* @param coordinatorEndpoint endpoint of the Coordinator.
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async estimateGasAsync(coordinatorEndpoint: string, txData?: Partial<TxData> | undefined): Promise<number> {
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
const self = (this as any) as CoordinatorRegistryContract;
@@ -107,6 +131,12 @@ export class CoordinatorRegistryContract extends BaseContract {
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
return gas;
},
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param coordinatorEndpoint endpoint of the Coordinator.
*/
async callAsync(
coordinatorEndpoint: string,
callData: Partial<CallData> = {},
@@ -143,6 +173,12 @@ export class CoordinatorRegistryContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param coordinatorEndpoint endpoint of the Coordinator.
*/
getABIEncodedTransactionData(coordinatorEndpoint: string): string {
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
const self = (this as any) as CoordinatorRegistryContract;
@@ -151,8 +187,39 @@ export class CoordinatorRegistryContract extends BaseContract {
]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): void {
const self = (this as any) as CoordinatorRegistryContract;
const abiEncoder = self._lookupAbiEncoder('setCoordinatorEndpoint(string)');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): void {
const self = (this as any) as CoordinatorRegistryContract;
const abiEncoder = self._lookupAbiEncoder('setCoordinatorEndpoint(string)');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
return abiDecodedReturnData;
},
async validateAndSendTransactionAsync(
coordinatorEndpoint: string,
txData?: Partial<TxData> | undefined,
): Promise<string> {
await (this as any).setCoordinatorEndpoint.callAsync(coordinatorEndpoint, txData);
const txHash = await (this as any).setCoordinatorEndpoint.sendTransactionAsync(coordinatorEndpoint, txData);
return txHash;
},
};
/**
* Gets the endpoint for a Coordinator.
*/
public getCoordinatorEndpoint = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param coordinatorOperator operator of the Coordinator endpoint.
*/
async callAsync(
coordinatorOperator: string,
callData: Partial<CallData> = {},
@@ -191,6 +258,12 @@ export class CoordinatorRegistryContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param coordinatorOperator operator of the Coordinator endpoint.
*/
getABIEncodedTransactionData(coordinatorOperator: string): string {
assert.isString('coordinatorOperator', coordinatorOperator);
const self = (this as any) as CoordinatorRegistryContract;
@@ -199,6 +272,20 @@ export class CoordinatorRegistryContract extends BaseContract {
]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): string {
const self = (this as any) as CoordinatorRegistryContract;
const abiEncoder = self._lookupAbiEncoder('getCoordinatorEndpoint(address)');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): string {
const self = (this as any) as CoordinatorRegistryContract;
const abiEncoder = self._lookupAbiEncoder('getCoordinatorEndpoint(address)');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
return abiDecodedReturnData;
},
};
private readonly _subscriptionManager: SubscriptionManager<CoordinatorRegistryEventArgs, CoordinatorRegistryEvents>;
public static async deployFrom0xArtifactAsync(
@@ -219,8 +306,10 @@ export class CoordinatorRegistryContract extends BaseContract {
const bytecode = artifact.compilerOutput.evm.bytecode.object;
const abi = artifact.compilerOutput.abi;
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
for (const key of Object.keys(logDecodeDependencies)) {
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
if (Object.keys(logDecodeDependencies) !== undefined) {
for (const key of Object.keys(logDecodeDependencies)) {
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
}
}
return CoordinatorRegistryContract.deployAsync(
bytecode,
@@ -337,11 +426,11 @@ export class CoordinatorRegistryContract extends BaseContract {
}
/**
* Subscribe to an event type emitted by the CoordinatorRegistry contract.
* @param eventName The CoordinatorRegistry contract event you would like to subscribe to.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{maker: aUserAddressHex}`
* @param callback Callback that gets called when a log is added/removed
* @param isVerbose Enable verbose subscription warnings (e.g recoverable network issues encountered)
* @param eventName The CoordinatorRegistry contract event you would like to subscribe to.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{maker: aUserAddressHex}`
* @param callback Callback that gets called when a log is added/removed
* @param isVerbose Enable verbose subscription warnings (e.g recoverable network issues encountered)
* @return Subscription token used later to unsubscribe
*/
public subscribe<ArgsType extends CoordinatorRegistryEventArgs>(
@@ -367,7 +456,7 @@ export class CoordinatorRegistryContract extends BaseContract {
}
/**
* Cancel a subscription
* @param subscriptionToken Subscription token returned by `subscribe()`
* @param subscriptionToken Subscription token returned by `subscribe()`
*/
public unsubscribe(subscriptionToken: string): void {
this._subscriptionManager.unsubscribe(subscriptionToken);
@@ -380,11 +469,11 @@ export class CoordinatorRegistryContract extends BaseContract {
}
/**
* Gets historical logs without creating a subscription
* @param eventName The CoordinatorRegistry contract event you would like to subscribe to.
* @param blockRange Block range to get logs from.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{_from: aUserAddressHex}`
* @return Array of logs that match the parameters
* @param eventName The CoordinatorRegistry contract event you would like to subscribe to.
* @param blockRange Block range to get logs from.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{_from: aUserAddressHex}`
* @return Array of logs that match the parameters
*/
public async getLogsAsync<ArgsType extends CoordinatorRegistryEventArgs>(
eventName: CoordinatorRegistryEvents,

View File

@@ -55,6 +55,11 @@ export interface DummyERC20TokenApprovalEventArgs extends DecodedLogArgs {
// tslint:disable-next-line:class-name
export class DummyERC20TokenContract extends BaseContract {
public name = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
*/
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
schemas.addressSchema,
@@ -86,13 +91,43 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
*/
getABIEncodedTransactionData(): string {
const self = (this as any) as DummyERC20TokenContract;
const abiEncodedTransactionData = self._strictEncodeArguments('name()', []);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): string {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('name()');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): string {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('name()');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
return abiDecodedReturnData;
},
};
/**
* `msg.sender` approves `_spender` to spend `_value` tokens
*/
public approve = {
/**
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
* Ethereum operation and will cost gas.
* @param _spender The address of the account able to transfer the tokens
* @param _value The amount of wei to be approved for transfer
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async sendTransactionAsync(
_spender: string,
_value: BigNumber,
@@ -121,6 +156,15 @@ export class DummyERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
/**
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
* If the transaction was mined, but reverted, an error is thrown.
* @param _spender The address of the account able to transfer the tokens
* @param _value The amount of wei to be approved for transfer
* @param txData Additional data for transaction
* @param pollingIntervalMs Interval at which to poll for success
* @returns A promise that resolves when the transaction is successful
*/
awaitTransactionSuccessAsync(
_spender: string,
_value: BigNumber,
@@ -144,6 +188,13 @@ export class DummyERC20TokenContract extends BaseContract {
})(),
);
},
/**
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
* @param _spender The address of the account able to transfer the tokens
* @param _value The amount of wei to be approved for transfer
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async estimateGasAsync(
_spender: string,
_value: BigNumber,
@@ -171,6 +222,14 @@ export class DummyERC20TokenContract extends BaseContract {
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
return gas;
},
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param _spender The address of the account able to transfer the tokens
* @param _value The amount of wei to be approved for transfer
* @returns Always true if the call has enough gas to complete execution
*/
async callAsync(
_spender: string,
_value: BigNumber,
@@ -212,6 +271,13 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param _spender The address of the account able to transfer the tokens
* @param _value The amount of wei to be approved for transfer
*/
getABIEncodedTransactionData(_spender: string, _value: BigNumber): string {
assert.isString('_spender', _spender);
assert.isBigNumber('_value', _value);
@@ -222,8 +288,40 @@ export class DummyERC20TokenContract extends BaseContract {
]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): boolean {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<boolean>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): boolean {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData);
return abiDecodedReturnData;
},
async validateAndSendTransactionAsync(
_spender: string,
_value: BigNumber,
txData?: Partial<TxData> | undefined,
): Promise<string> {
await (this as any).approve.callAsync(_spender, _value, txData);
const txHash = await (this as any).approve.sendTransactionAsync(_spender, _value, txData);
return txHash;
},
};
/**
* Query total supply of token
*/
public totalSupply = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @returns Total supply of token
*/
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
schemas.addressSchema,
@@ -255,13 +353,44 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
*/
getABIEncodedTransactionData(): string {
const self = (this as any) as DummyERC20TokenContract;
const abiEncodedTransactionData = self._strictEncodeArguments('totalSupply()', []);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): BigNumber {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): BigNumber {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
return abiDecodedReturnData;
},
};
/**
* ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717
*/
public transferFrom = {
/**
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
* Ethereum operation and will cost gas.
* @param _from Address to transfer from.
* @param _to Address to transfer to.
* @param _value Amount to transfer.
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async sendTransactionAsync(
_from: string,
_to: string,
@@ -293,6 +422,16 @@ export class DummyERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
/**
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
* If the transaction was mined, but reverted, an error is thrown.
* @param _from Address to transfer from.
* @param _to Address to transfer to.
* @param _value Amount to transfer.
* @param txData Additional data for transaction
* @param pollingIntervalMs Interval at which to poll for success
* @returns A promise that resolves when the transaction is successful
*/
awaitTransactionSuccessAsync(
_from: string,
_to: string,
@@ -323,6 +462,14 @@ export class DummyERC20TokenContract extends BaseContract {
})(),
);
},
/**
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
* @param _from Address to transfer from.
* @param _to Address to transfer to.
* @param _value Amount to transfer.
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async estimateGasAsync(
_from: string,
_to: string,
@@ -353,6 +500,15 @@ export class DummyERC20TokenContract extends BaseContract {
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
return gas;
},
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param _from Address to transfer from.
* @param _to Address to transfer to.
* @param _value Amount to transfer.
* @returns Success of transfer.
*/
async callAsync(
_from: string,
_to: string,
@@ -397,6 +553,14 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param _from Address to transfer from.
* @param _to Address to transfer to.
* @param _value Amount to transfer.
*/
getABIEncodedTransactionData(_from: string, _to: string, _value: BigNumber): string {
assert.isString('_from', _from);
assert.isString('_to', _to);
@@ -409,8 +573,37 @@ export class DummyERC20TokenContract extends BaseContract {
]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): boolean {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<boolean>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): boolean {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData);
return abiDecodedReturnData;
},
async validateAndSendTransactionAsync(
_from: string,
_to: string,
_value: BigNumber,
txData?: Partial<TxData> | undefined,
): Promise<string> {
await (this as any).transferFrom.callAsync(_from, _to, _value, txData);
const txHash = await (this as any).transferFrom.sendTransactionAsync(_from, _to, _value, txData);
return txHash;
},
};
public decimals = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
*/
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
schemas.addressSchema,
@@ -442,13 +635,42 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
*/
getABIEncodedTransactionData(): string {
const self = (this as any) as DummyERC20TokenContract;
const abiEncodedTransactionData = self._strictEncodeArguments('decimals()', []);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): BigNumber {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('decimals()');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): BigNumber {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('decimals()');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
return abiDecodedReturnData;
},
};
/**
* Query the balance of owner
*/
public balanceOf = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param _owner The address from which the balance will be retrieved
* @returns Balance of owner
*/
async callAsync(
_owner: string,
callData: Partial<CallData> = {},
@@ -485,14 +707,39 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param _owner The address from which the balance will be retrieved
*/
getABIEncodedTransactionData(_owner: string): string {
assert.isString('_owner', _owner);
const self = (this as any) as DummyERC20TokenContract;
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): BigNumber {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): BigNumber {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
return abiDecodedReturnData;
},
};
public owner = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
*/
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
schemas.addressSchema,
@@ -524,13 +771,37 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
*/
getABIEncodedTransactionData(): string {
const self = (this as any) as DummyERC20TokenContract;
const abiEncodedTransactionData = self._strictEncodeArguments('owner()', []);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): string {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('owner()');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): string {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('owner()');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
return abiDecodedReturnData;
},
};
public symbol = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
*/
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
schemas.addressSchema,
@@ -562,13 +833,42 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
*/
getABIEncodedTransactionData(): string {
const self = (this as any) as DummyERC20TokenContract;
const abiEncodedTransactionData = self._strictEncodeArguments('symbol()', []);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): string {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('symbol()');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): string {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('symbol()');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
return abiDecodedReturnData;
},
};
/**
* Mints new tokens for sender
*/
public mint = {
/**
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
* Ethereum operation and will cost gas.
* @param _value Amount of tokens to mint
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async sendTransactionAsync(_value: BigNumber, txData?: Partial<TxData> | undefined): Promise<string> {
assert.isBigNumber('_value', _value);
const self = (this as any) as DummyERC20TokenContract;
@@ -589,6 +889,14 @@ export class DummyERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
/**
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
* If the transaction was mined, but reverted, an error is thrown.
* @param _value Amount of tokens to mint
* @param txData Additional data for transaction
* @param pollingIntervalMs Interval at which to poll for success
* @returns A promise that resolves when the transaction is successful
*/
awaitTransactionSuccessAsync(
_value: BigNumber,
txData?: Partial<TxData>,
@@ -610,6 +918,12 @@ export class DummyERC20TokenContract extends BaseContract {
})(),
);
},
/**
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
* @param _value Amount of tokens to mint
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async estimateGasAsync(_value: BigNumber, txData?: Partial<TxData> | undefined): Promise<number> {
assert.isBigNumber('_value', _value);
const self = (this as any) as DummyERC20TokenContract;
@@ -629,6 +943,12 @@ export class DummyERC20TokenContract extends BaseContract {
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
return gas;
},
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param _value Amount of tokens to mint
*/
async callAsync(_value: BigNumber, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
assert.isBigNumber('_value', _value);
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
@@ -661,14 +981,53 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param _value Amount of tokens to mint
*/
getABIEncodedTransactionData(_value: BigNumber): string {
assert.isBigNumber('_value', _value);
const self = (this as any) as DummyERC20TokenContract;
const abiEncodedTransactionData = self._strictEncodeArguments('mint(uint256)', [_value]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): void {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('mint(uint256)');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): void {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('mint(uint256)');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
return abiDecodedReturnData;
},
async validateAndSendTransactionAsync(
_value: BigNumber,
txData?: Partial<TxData> | undefined,
): Promise<string> {
await (this as any).mint.callAsync(_value, txData);
const txHash = await (this as any).mint.sendTransactionAsync(_value, txData);
return txHash;
},
};
/**
* send `value` token to `to` from `msg.sender`
*/
public transfer = {
/**
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
* Ethereum operation and will cost gas.
* @param _to The address of the recipient
* @param _value The amount of token to be transferred
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async sendTransactionAsync(
_to: string,
_value: BigNumber,
@@ -694,6 +1053,15 @@ export class DummyERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
/**
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
* If the transaction was mined, but reverted, an error is thrown.
* @param _to The address of the recipient
* @param _value The amount of token to be transferred
* @param txData Additional data for transaction
* @param pollingIntervalMs Interval at which to poll for success
* @returns A promise that resolves when the transaction is successful
*/
awaitTransactionSuccessAsync(
_to: string,
_value: BigNumber,
@@ -717,6 +1085,13 @@ export class DummyERC20TokenContract extends BaseContract {
})(),
);
},
/**
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
* @param _to The address of the recipient
* @param _value The amount of token to be transferred
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async estimateGasAsync(_to: string, _value: BigNumber, txData?: Partial<TxData> | undefined): Promise<number> {
assert.isString('_to', _to);
assert.isBigNumber('_value', _value);
@@ -737,6 +1112,14 @@ export class DummyERC20TokenContract extends BaseContract {
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
return gas;
},
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param _to The address of the recipient
* @param _value The amount of token to be transferred
* @returns True if transfer was successful
*/
async callAsync(
_to: string,
_value: BigNumber,
@@ -775,6 +1158,13 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param _to The address of the recipient
* @param _value The amount of token to be transferred
*/
getABIEncodedTransactionData(_to: string, _value: BigNumber): string {
assert.isString('_to', _to);
assert.isBigNumber('_value', _value);
@@ -785,8 +1175,39 @@ export class DummyERC20TokenContract extends BaseContract {
]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): boolean {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<boolean>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): boolean {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData);
return abiDecodedReturnData;
},
async validateAndSendTransactionAsync(
_to: string,
_value: BigNumber,
txData?: Partial<TxData> | undefined,
): Promise<string> {
await (this as any).transfer.callAsync(_to, _value, txData);
const txHash = await (this as any).transfer.sendTransactionAsync(_to, _value, txData);
return txHash;
},
};
public allowance = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param _owner The address of the account owning tokens
* @param _spender The address of the account able to transfer the tokens
* @returns Amount of remaining tokens allowed to spent
*/
async callAsync(
_owner: string,
_spender: string,
@@ -828,6 +1249,13 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param _owner The address of the account owning tokens
* @param _spender The address of the account able to transfer the tokens
*/
getABIEncodedTransactionData(_owner: string, _spender: string): string {
assert.isString('_owner', _owner);
assert.isString('_spender', _spender);
@@ -838,8 +1266,33 @@ export class DummyERC20TokenContract extends BaseContract {
]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): BigNumber {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): BigNumber {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
return abiDecodedReturnData;
},
};
/**
* Sets the balance of target address
*/
public setBalance = {
/**
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
* Ethereum operation and will cost gas.
* @param _target Address or which balance will be updated
* @param _value New balance of target address
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async sendTransactionAsync(
_target: string,
_value: BigNumber,
@@ -868,6 +1321,15 @@ export class DummyERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
/**
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
* If the transaction was mined, but reverted, an error is thrown.
* @param _target Address or which balance will be updated
* @param _value New balance of target address
* @param txData Additional data for transaction
* @param pollingIntervalMs Interval at which to poll for success
* @returns A promise that resolves when the transaction is successful
*/
awaitTransactionSuccessAsync(
_target: string,
_value: BigNumber,
@@ -891,6 +1353,13 @@ export class DummyERC20TokenContract extends BaseContract {
})(),
);
},
/**
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
* @param _target Address or which balance will be updated
* @param _value New balance of target address
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async estimateGasAsync(
_target: string,
_value: BigNumber,
@@ -918,6 +1387,13 @@ export class DummyERC20TokenContract extends BaseContract {
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
return gas;
},
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
* @param _target Address or which balance will be updated
* @param _value New balance of target address
*/
async callAsync(
_target: string,
_value: BigNumber,
@@ -959,6 +1435,13 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
* @param _target Address or which balance will be updated
* @param _value New balance of target address
*/
getABIEncodedTransactionData(_target: string, _value: BigNumber): string {
assert.isString('_target', _target);
assert.isBigNumber('_value', _value);
@@ -969,8 +1452,37 @@ export class DummyERC20TokenContract extends BaseContract {
]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): void {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('setBalance(address,uint256)');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): void {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('setBalance(address,uint256)');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
return abiDecodedReturnData;
},
async validateAndSendTransactionAsync(
_target: string,
_value: BigNumber,
txData?: Partial<TxData> | undefined,
): Promise<string> {
await (this as any).setBalance.callAsync(_target, _value, txData);
const txHash = await (this as any).setBalance.sendTransactionAsync(_target, _value, txData);
return txHash;
},
};
public transferOwnership = {
/**
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
* Ethereum operation and will cost gas.
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
assert.isString('newOwner', newOwner);
const self = (this as any) as DummyERC20TokenContract;
@@ -991,6 +1503,13 @@ export class DummyERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
/**
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
* If the transaction was mined, but reverted, an error is thrown.
* @param txData Additional data for transaction
* @param pollingIntervalMs Interval at which to poll for success
* @returns A promise that resolves when the transaction is successful
*/
awaitTransactionSuccessAsync(
newOwner: string,
txData?: Partial<TxData>,
@@ -1012,6 +1531,11 @@ export class DummyERC20TokenContract extends BaseContract {
})(),
);
},
/**
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
* @param txData Additional data for transaction
* @returns The hash of the transaction
*/
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
assert.isString('newOwner', newOwner);
const self = (this as any) as DummyERC20TokenContract;
@@ -1031,6 +1555,11 @@ export class DummyERC20TokenContract extends BaseContract {
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
return gas;
},
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
*/
async callAsync(newOwner: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
assert.isString('newOwner', newOwner);
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
@@ -1063,6 +1592,11 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
*/
getABIEncodedTransactionData(newOwner: string): string {
assert.isString('newOwner', newOwner);
const self = (this as any) as DummyERC20TokenContract;
@@ -1071,8 +1605,32 @@ export class DummyERC20TokenContract extends BaseContract {
]);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): void {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): void {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
return abiDecodedReturnData;
},
async validateAndSendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
await (this as any).transferOwnership.callAsync(newOwner, txData);
const txHash = await (this as any).transferOwnership.sendTransactionAsync(newOwner, txData);
return txHash;
},
};
public MAX_MINT_AMOUNT = {
/**
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
* since they don't modify state.
*/
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
schemas.addressSchema,
@@ -1104,11 +1662,30 @@ export class DummyERC20TokenContract extends BaseContract {
// tslint:enable boolean-naming
return result;
},
/**
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
* to create a 0x transaction (see protocol spec for more details).
*/
getABIEncodedTransactionData(): string {
const self = (this as any) as DummyERC20TokenContract;
const abiEncodedTransactionData = self._strictEncodeArguments('MAX_MINT_AMOUNT()', []);
return abiEncodedTransactionData;
},
getABIDecodedTransactionData(callData: string): BigNumber {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('MAX_MINT_AMOUNT()');
// tslint:disable boolean-naming
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
return abiDecodedCallData;
},
getABIDecodedReturnData(returnData: string): BigNumber {
const self = (this as any) as DummyERC20TokenContract;
const abiEncoder = self._lookupAbiEncoder('MAX_MINT_AMOUNT()');
// tslint:disable boolean-naming
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
return abiDecodedReturnData;
},
};
private readonly _subscriptionManager: SubscriptionManager<DummyERC20TokenEventArgs, DummyERC20TokenEvents>;
public static async deployFrom0xArtifactAsync(
@@ -1133,8 +1710,10 @@ export class DummyERC20TokenContract extends BaseContract {
const bytecode = artifact.compilerOutput.evm.bytecode.object;
const abi = artifact.compilerOutput.abi;
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
for (const key of Object.keys(logDecodeDependencies)) {
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
if (Object.keys(logDecodeDependencies) !== undefined) {
for (const key of Object.keys(logDecodeDependencies)) {
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
}
}
return DummyERC20TokenContract.deployAsync(
bytecode,
@@ -1520,11 +2099,11 @@ export class DummyERC20TokenContract extends BaseContract {
}
/**
* Subscribe to an event type emitted by the DummyERC20Token contract.
* @param eventName The DummyERC20Token contract event you would like to subscribe to.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{maker: aUserAddressHex}`
* @param callback Callback that gets called when a log is added/removed
* @param isVerbose Enable verbose subscription warnings (e.g recoverable network issues encountered)
* @param eventName The DummyERC20Token contract event you would like to subscribe to.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{maker: aUserAddressHex}`
* @param callback Callback that gets called when a log is added/removed
* @param isVerbose Enable verbose subscription warnings (e.g recoverable network issues encountered)
* @return Subscription token used later to unsubscribe
*/
public subscribe<ArgsType extends DummyERC20TokenEventArgs>(
@@ -1550,7 +2129,7 @@ export class DummyERC20TokenContract extends BaseContract {
}
/**
* Cancel a subscription
* @param subscriptionToken Subscription token returned by `subscribe()`
* @param subscriptionToken Subscription token returned by `subscribe()`
*/
public unsubscribe(subscriptionToken: string): void {
this._subscriptionManager.unsubscribe(subscriptionToken);
@@ -1563,11 +2142,11 @@ export class DummyERC20TokenContract extends BaseContract {
}
/**
* Gets historical logs without creating a subscription
* @param eventName The DummyERC20Token contract event you would like to subscribe to.
* @param blockRange Block range to get logs from.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{_from: aUserAddressHex}`
* @return Array of logs that match the parameters
* @param eventName The DummyERC20Token contract event you would like to subscribe to.
* @param blockRange Block range to get logs from.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{_from: aUserAddressHex}`
* @return Array of logs that match the parameters
*/
public async getLogsAsync<ArgsType extends DummyERC20TokenEventArgs>(
eventName: DummyERC20TokenEvents,

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