Compare commits
187 Commits
@0x/contra
...
@0x/contra
Author | SHA1 | Date | |
---|---|---|---|
|
bbd3c03969 | ||
|
a4405c3d39 | ||
|
0fe4f587d8 | ||
|
d3c714bd17 | ||
|
c399b7a7d5 | ||
|
b9234e94fb | ||
|
417bb87785 | ||
|
0233ae3134 | ||
|
eed0c5dd59 | ||
|
2b3b167095 | ||
|
5d91d19808 | ||
|
0f374ddee9 | ||
|
a65a9913cd | ||
|
1ead32c666 | ||
|
d1af9fc780 | ||
|
0f06737fb6 | ||
|
1676231532 | ||
|
b1caf697c8 | ||
|
51481065fe | ||
|
e367da710c | ||
|
f493d6524d | ||
|
e1b85da2a7 | ||
|
22c6548ed1 | ||
|
afb32c087d | ||
|
bbc1ed1c64 | ||
|
3a46f1a27a | ||
|
90cd364780 | ||
|
6795e6f078 | ||
|
cfb3404349 | ||
|
0212f3ee78 | ||
|
6b2995a4ee | ||
|
09e7ac54d4 | ||
|
f69009d4a8 | ||
|
206802ae33 | ||
|
91d4138fb8 | ||
|
cb455f951a | ||
|
5f25d20cd0 | ||
|
1f0e2cd910 | ||
|
1749d02701 | ||
|
55ace3179c | ||
|
7866d9ccb4 | ||
|
51f73d07fa | ||
|
63d84674ab | ||
|
14066997b2 | ||
|
28561e765a | ||
|
453fbbdc5d | ||
|
1e1e5ec10d | ||
|
2088b0e459 | ||
|
58400d9e01 | ||
|
ac9375f1d2 | ||
|
db061c9355 | ||
|
d5ce6c464b | ||
|
b06205bb7f | ||
|
f528a3e1de | ||
|
bddfdacfad | ||
|
d3cdd3f235 | ||
|
41ae45ea40 | ||
|
657e0895ea | ||
|
0ae2d8bab5 | ||
|
3e0bd1f02d | ||
|
b2592d1cc2 | ||
|
aa3524c3b2 | ||
|
35fcfb978d | ||
|
c68083cf03 | ||
|
39deb1a05f | ||
|
302d08e290 | ||
|
05489dd7f1 | ||
|
cfb5119efc | ||
|
5d53fa5635 | ||
|
38d2b70ba6 | ||
|
29d5db16c2 | ||
|
a8128c5772 | ||
|
55bd076602 | ||
|
53a08d00fd | ||
|
fccec66463 | ||
|
bc26e807cd | ||
|
46dc37fb20 | ||
|
ccbb8400ee | ||
|
5d3d8a5332 | ||
|
7a224fe08f | ||
|
e045f5f74b | ||
|
e5c07ff0c5 | ||
|
cdf0aa27e4 | ||
|
88998e6bb7 | ||
|
b885dfa606 | ||
|
407495c278 | ||
|
ea50a94355 | ||
|
cb3318972e | ||
|
c057ad7977 | ||
|
eb21718462 | ||
|
7836e10d8a | ||
|
946a31821d | ||
|
92a915f477 | ||
|
60b458dbfb | ||
|
8b13efc89a | ||
|
88b625fa15 | ||
|
2cf9c9b7df | ||
|
d179d6a1a2 | ||
|
08502c1eb6 | ||
|
384cd47416 | ||
|
3bdeb82097 | ||
|
f49ab3f919 | ||
|
42d5bdd3ab | ||
|
7228cbfe92 | ||
|
250c46d6a4 | ||
|
f394d7dba9 | ||
|
ca595cd8cf | ||
|
9ce71739f5 | ||
|
d69da38f7d | ||
|
50f69f734f | ||
|
fc9c6c5434 | ||
|
6e941be1e9 | ||
|
9f677150a4 | ||
|
11e273337f | ||
|
ec807120c3 | ||
|
a5654debeb | ||
|
0869c0d8b0 | ||
|
b456c3f953 | ||
|
8297d68166 | ||
|
18ce6797e0 | ||
|
c1009d440e | ||
|
89ee6fe6db | ||
|
38a12475bc | ||
|
9a800264a2 | ||
|
8ce390be3c | ||
|
cc93532f4f | ||
|
37cc40521c | ||
|
5ac7ff7084 | ||
|
e682b82ca8 | ||
|
7cd1fd0aaa | ||
|
8cd99c5a40 | ||
|
ad83312009 | ||
|
9e3b1fe333 | ||
|
c3f42995f9 | ||
|
3d3a02c892 | ||
|
06bec227ad | ||
|
5d7803323c | ||
|
4303f9a025 | ||
|
fe4c5434fa | ||
|
9325bb70c5 | ||
|
b164557165 | ||
|
424f984ea8 | ||
|
78c704e3d1 | ||
|
50f1a8fbd8 | ||
|
0f90b7b5da | ||
|
bec4384a5d | ||
|
f361efae5a | ||
|
76ca2116ab | ||
|
33d8646dc5 | ||
|
3cb5190bc6 | ||
|
5bba06bef8 | ||
|
dd3f672a35 | ||
|
25ef3b8445 | ||
|
7eb2d290d8 | ||
|
678762910b | ||
|
da28a542c7 | ||
|
92602d33ad | ||
|
03f04f4bb3 | ||
|
0d4dd5ff0d | ||
|
884864cc58 | ||
|
7c199d83be | ||
|
5b4c29c4bb | ||
|
f97ee80955 | ||
|
547322ae63 | ||
|
db74db622e | ||
|
57318c0041 | ||
|
4eb0767834 | ||
|
92bb7808ce | ||
|
abfe7d1613 | ||
|
6c72239365 | ||
|
8001daad8c | ||
|
73a38ab4f4 | ||
|
281c207921 | ||
|
ae531eef5f | ||
|
d8b11238e6 | ||
|
11e2fc5bc4 | ||
|
3e88f820b8 | ||
|
163750f8c2 | ||
|
4aabc5d791 | ||
|
c9a7b9dcc1 | ||
|
98075b5653 | ||
|
57ae5be916 | ||
|
8caf62997f | ||
|
f8656ad376 | ||
|
29c6c2a2ad | ||
|
f2db67ef02 | ||
|
72b8ef33d9 |
@@ -4,18 +4,23 @@ jobs:
|
||||
build:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
environment:
|
||||
CONTRACTS_COMMIT_HASH: '9ed05f5'
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
|
||||
- run:
|
||||
# HACK(albrow): Without this, yarn commands will sometimes
|
||||
# fail with a "permission denied" error.
|
||||
name: Set npm path
|
||||
command: npm set prefix=/home/circleci/npm && echo 'export PATH=$HOME/circleci/npm/bin:$PATH' >> /home/circleci/.bashrc
|
||||
# HACK(feuGeneA): commented out this hack as we're changing
|
||||
# from a circleci-maintained container to a different
|
||||
# container, and this hack may not apply anymore, as
|
||||
# suggested by the non-existance of `/home/circleci/.bashrc`
|
||||
# when running the command below.
|
||||
# - run:
|
||||
# # HACK(albrow): Without this, yarn commands will sometimes
|
||||
# # fail with a "permission denied" error.
|
||||
# name: Set npm path
|
||||
# command: npm set prefix=/home/circleci/npm && echo 'export PATH=$HOME/circleci/npm/bin:$PATH' >> /home/circleci/.bashrc
|
||||
- run:
|
||||
name: install-yarn
|
||||
command: npm install --global yarn@1.9.4
|
||||
@@ -37,10 +42,12 @@ jobs:
|
||||
path: ~/repo/packages/python-contract-wrappers/generated
|
||||
- store_artifacts:
|
||||
path: ~/repo/packages/abi-gen/test-cli/output
|
||||
- store_artifacts:
|
||||
path: ~/repo/packages/abi-gen-wrappers/generated_docs
|
||||
build-website:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -48,8 +55,9 @@ jobs:
|
||||
- repo-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- run: cd packages/website && yarn build:prod
|
||||
test-contracts-ganache:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -58,7 +66,7 @@ jobs:
|
||||
- run: yarn wsrun test:circleci @0x/contracts-multisig @0x/contracts-utils @0x/contracts-exchange-libs @0x/contracts-erc20 @0x/contracts-erc721 @0x/contracts-erc1155 @0x/contracts-extensions @0x/contracts-asset-proxy @0x/contracts-exchange @0x/contracts-exchange-forwarder @0x/contracts-coordinator @0x/contracts-dev-utils
|
||||
test-contracts-geth:
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
- image: 0xorg/devnet
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
@@ -71,7 +79,7 @@ jobs:
|
||||
test-publish:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
- image: 0xorg/verdaccio
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
@@ -81,7 +89,7 @@ jobs:
|
||||
- run: yarn test:publish:circleci
|
||||
test-doc-generation:
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -90,7 +98,7 @@ jobs:
|
||||
- run: yarn test:generate_docs:circleci
|
||||
test-rest:
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -107,7 +115,6 @@ jobs:
|
||||
- run: yarn wsrun test:circleci @0x/dev-utils
|
||||
- run: yarn wsrun test:circleci @0x/json-schemas
|
||||
- run: yarn wsrun test:circleci @0x/order-utils
|
||||
- run: yarn wsrun test:circleci @0x/order-watcher
|
||||
- run: yarn wsrun test:circleci @0x/sol-compiler
|
||||
- run: yarn wsrun test:circleci @0x/sol-tracing-utils
|
||||
- run: yarn wsrun test:circleci @0x/sol-doc
|
||||
@@ -151,10 +158,6 @@ jobs:
|
||||
key: coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/order-utils/coverage/lcov.info
|
||||
- save_cache:
|
||||
key: coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/order-watcher/coverage/lcov.info
|
||||
- save_cache:
|
||||
key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
@@ -178,18 +181,17 @@ jobs:
|
||||
test-python:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/python
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
- image: 0xorg/ganache-cli:2.2.2
|
||||
- image: 0xorg/launch-kit-ci
|
||||
- image: 0xorg/launch-kit-backend:74bcc39
|
||||
environment:
|
||||
RPC_URL: http://localhost:8545
|
||||
NETWORK_ID: 50
|
||||
WHITELIST_ALL_TOKENS: True
|
||||
command: bash -c "until curl -sfd'{\"method\":\"net_listening\"}' http://localhost:8545 | grep true; do continue; done; forever ts/lib/index.js"
|
||||
command: |
|
||||
sh -c "until printf 'POST /\r\nContent-Length: 26\r\n\r\n{\"method\":\"net_listening\"}' | nc localhost 8545 | grep true; do continue; done; node_modules/.bin/forever ts/lib/index.js"
|
||||
steps:
|
||||
- checkout
|
||||
- run: sudo chown -R circleci:circleci /usr/local/bin
|
||||
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
|
||||
- restore_cache:
|
||||
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
@@ -208,7 +210,7 @@ jobs:
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages
|
||||
./parallel coverage run setup.py test
|
||||
./parallel_without_sra_client coverage run setup.py test
|
||||
./build_docs
|
||||
- save_cache:
|
||||
key: coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }}
|
||||
@@ -255,11 +257,9 @@ jobs:
|
||||
test-rest-python:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/python
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
steps:
|
||||
- checkout
|
||||
- run: sudo chown -R circleci:circleci /usr/local/bin
|
||||
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
|
||||
- restore_cache:
|
||||
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- run:
|
||||
@@ -283,11 +283,9 @@ jobs:
|
||||
static-tests-python:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/python
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
steps:
|
||||
- checkout
|
||||
- run: sudo chown -R circleci:circleci /usr/local/bin
|
||||
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
|
||||
- restore_cache:
|
||||
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
@@ -302,7 +300,7 @@ jobs:
|
||||
static-tests:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
@@ -314,7 +312,7 @@ jobs:
|
||||
- run: yarn bundlewatch
|
||||
submit-coverage:
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -347,9 +345,6 @@ jobs:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
||||
|
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -4,4 +4,5 @@
|
||||
*.svg linguist-generated=true
|
||||
packages/contract-artifacts/artifacts/*json linguist-generated=true
|
||||
packages/abi-gen-wrappers/src/generated-wrappers/*.ts linguist-generated=true
|
||||
packages/contract-wrappers/src/generated-wrappers/*.ts linguist-generated=true
|
||||
|
||||
|
1
.github/autolabeler.yml
vendored
1
.github/autolabeler.yml
vendored
@@ -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
21
.gitignore
vendored
@@ -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/
|
||||
|
@@ -28,6 +28,7 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
|
||||
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| [`0x-contract-addresses`](/python-packages/contract_addresses) | [](https://pypi.org/project/0x-contract-addresses/) | A tiny utility library for getting known deployed contract addresses for a particular network |
|
||||
| [`0x-contract-artifacts`](/python-packages/contract_artifacts) | [](https://pypi.org/project/0x-contract-artifacts/) | 0x smart contract compilation artifacts |
|
||||
| [`0x-contract-wrappers`](/python-packages/contract_wrappers) | [](https://pypi.org/project/0x-contract-wrappers/) | 0x smart contract wrappers |
|
||||
| [`0x-json-schemas`](/python-packages/json_schemas) | [](https://pypi.org/project/0x-json-schemas/) | 0x-related JSON schemas |
|
||||
| [`0x-order-utils`](/python-packages/order_utils) | [](https://pypi.org/project/0x-order-utils/) | A set of utilities for generating, parsing, signing and validating 0x orders |
|
||||
| [`0x-sra-client`](/python-packages/sra_client) | [](https://pypi.org/project/0x-sra-client/) | A Python client for interacting with servers conforming to the Standard Relayer API specification |
|
||||
@@ -62,8 +63,7 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
||||
| [`@0x/contract-addresses`](/packages/contract-addresses) | [](https://www.npmjs.com/package/@0x/contract-addresses) | A tiny utility library for getting known deployed contract addresses for a particular network. |
|
||||
| [`@0x/contract-wrappers`](/packages/contract-wrappers) | [](https://www.npmjs.com/package/@0x/contract-wrappers) | JS/TS wrappers for interacting with the 0x smart contracts |
|
||||
| [`@0x/order-utils`](/packages/order-utils) | [](https://www.npmjs.com/package/@0x/order-utils) | A set of utilities for generating, parsing, signing and validating 0x orders |
|
||||
| [`@0x/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas |
|
||||
| [`@0x/order-watcher`](/packages/order-watcher) | [](https://www.npmjs.com/package/@0x/order-watcher) | An order watcher daemon that watches for order validity |
|
||||
| [`@0x/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas | |
|
||||
| [`@0x/migrations`](/packages/migrations) | [](https://www.npmjs.com/package/@0x/migrations) | Migration tool for deploying 0x smart contracts on private testnets |
|
||||
| [`@0x/contract-artifacts`](/packages/contract-artifacts) | [](https://www.npmjs.com/package/@0x/contract-artifacts) | 0x smart contract compilation artifacts |
|
||||
| [`@0x/abi-gen-wrappers`](/packages/abi-gen-wrappers) | [](https://www.npmjs.com/package/@0x/abi-gen-wrappers) | Low-level 0x smart contract wrappers generated using `@0x/abi-gen` |
|
||||
@@ -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:
|
||||
|
@@ -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,
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
|
@@ -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,
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
|
@@ -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.",
|
||||
|
@@ -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_
|
||||
|
@@ -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"
|
||||
},
|
||||
|
@@ -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": [
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
},
|
||||
|
@@ -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": [
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
},
|
||||
|
@@ -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": [
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
},
|
||||
|
@@ -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,
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
},
|
||||
|
@@ -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": [
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
},
|
||||
|
@@ -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,
|
||||
|
@@ -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)
|
||||
|
@@ -21,7 +21,7 @@ pragma solidity ^0.5.5;
|
||||
import "../src/interfaces/IValidator.sol";
|
||||
|
||||
|
||||
contract Validator is
|
||||
contract Validator is
|
||||
IValidator
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ contract Validator is
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param signerAddress Address that should have signed the given hash.
|
||||
/// @param signature Proof of signing.
|
||||
/// @return Validity of signature.
|
||||
/// @return Returns a known magic value if the signature is valid.
|
||||
// solhint-disable no-unused-vars
|
||||
function isValidSignature(
|
||||
bytes32 hash,
|
||||
@@ -48,9 +48,11 @@ contract Validator is
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid)
|
||||
returns (bytes4)
|
||||
{
|
||||
return (signerAddress == VALID_SIGNER);
|
||||
require(signerAddress == VALID_SIGNER, "INVALID_SIGNER");
|
||||
bytes4 magicValue = bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"));
|
||||
return magicValue;
|
||||
}
|
||||
// solhint-enable no-unused-vars
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ import "../src/interfaces/IWallet.sol";
|
||||
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||
|
||||
|
||||
contract Wallet is
|
||||
contract Wallet is
|
||||
IWallet
|
||||
{
|
||||
using LibBytes for bytes;
|
||||
@@ -41,14 +41,14 @@ contract Wallet is
|
||||
/// The signer must match the owner of this wallet.
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param eip712Signature Proof of signing.
|
||||
/// @return Validity of signature.
|
||||
/// @return Returns a known magic value if the signature is valid.
|
||||
function isValidSignature(
|
||||
bytes32 hash,
|
||||
bytes calldata eip712Signature
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid)
|
||||
returns (bytes4)
|
||||
{
|
||||
require(
|
||||
eip712Signature.length == 65,
|
||||
@@ -59,7 +59,8 @@ contract Wallet is
|
||||
bytes32 r = eip712Signature.readBytes32(1);
|
||||
bytes32 s = eip712Signature.readBytes32(33);
|
||||
address recoveredAddress = ecrecover(hash, v, r, s);
|
||||
isValid = WALLET_OWNER == recoveredAddress;
|
||||
return isValid;
|
||||
require(WALLET_OWNER == recoveredAddress, "INVALID_SIGNATURE");
|
||||
bytes4 magicValue = bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"));
|
||||
return magicValue;
|
||||
}
|
||||
}
|
||||
|
@@ -73,10 +73,12 @@ contract Whitelist is
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid)
|
||||
returns (bytes4)
|
||||
{
|
||||
// solhint-disable-next-line avoid-tx-origin
|
||||
return signerAddress == tx.origin;
|
||||
require(signerAddress == tx.origin, "INVALID_SIGNER");
|
||||
bytes4 magicValue = bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"));
|
||||
return magicValue;
|
||||
}
|
||||
// solhint-enable no-unused-vars
|
||||
|
||||
|
@@ -32,7 +32,7 @@ contract MixinSignatureValidator is
|
||||
MTransactions
|
||||
{
|
||||
using LibBytes for bytes;
|
||||
|
||||
|
||||
// Mapping of hash => signer => signed
|
||||
mapping (bytes32 => mapping (address => bool)) public preSigned;
|
||||
|
||||
@@ -197,7 +197,7 @@ contract MixinSignatureValidator is
|
||||
} else if (signatureType == SignatureType.Validator) {
|
||||
// Pop last 20 bytes off of signature byte array.
|
||||
address validatorAddress = signature.popLast20Bytes();
|
||||
|
||||
|
||||
// Ensure signer has approved validator.
|
||||
if (!allowedValidators[signerAddress][validatorAddress]) {
|
||||
return false;
|
||||
@@ -224,7 +224,8 @@ contract MixinSignatureValidator is
|
||||
revert("SIGNATURE_UNSUPPORTED");
|
||||
}
|
||||
|
||||
/// @dev Verifies signature using logic defined by Wallet contract.
|
||||
/// @dev Verifies signature using logic defined by Wallet contract. Wallet contract
|
||||
/// must return `bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"))`
|
||||
/// @param hash Any 32 byte hash.
|
||||
/// @param walletAddress Address that should have signed the given hash
|
||||
/// and defines its own signature verification method.
|
||||
@@ -244,7 +245,19 @@ contract MixinSignatureValidator is
|
||||
hash,
|
||||
signature
|
||||
);
|
||||
// bytes4 0xb0671381
|
||||
bytes32 magicValue = bytes32(bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)")));
|
||||
assembly {
|
||||
// extcodesize added as an extra safety measure
|
||||
if iszero(extcodesize(walletAddress)) {
|
||||
// Revert with `Error("WALLET_ERROR")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
let cdStart := add(callData, 32)
|
||||
let success := staticcall(
|
||||
gas, // forward all gas
|
||||
@@ -255,6 +268,15 @@ contract MixinSignatureValidator is
|
||||
32 // output size is 32 bytes
|
||||
)
|
||||
|
||||
if iszero(eq(returndatasize(), 32)) {
|
||||
// Revert with `Error("WALLET_ERROR")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
switch success
|
||||
case 0 {
|
||||
// Revert with `Error("WALLET_ERROR")`
|
||||
@@ -266,13 +288,17 @@ contract MixinSignatureValidator is
|
||||
}
|
||||
case 1 {
|
||||
// Signature is valid if call did not revert and returned true
|
||||
isValid := mload(cdStart)
|
||||
isValid := eq(
|
||||
and(mload(cdStart), 0xffffffff00000000000000000000000000000000000000000000000000000000),
|
||||
and(magicValue, 0xffffffff00000000000000000000000000000000000000000000000000000000)
|
||||
)
|
||||
}
|
||||
}
|
||||
return isValid;
|
||||
}
|
||||
|
||||
/// @dev Verifies signature using logic defined by Validator contract.
|
||||
/// Validator must return `bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"))`
|
||||
/// @param validatorAddress Address of validator contract.
|
||||
/// @param hash Any 32 byte hash.
|
||||
/// @param signerAddress Address that should have signed the given hash.
|
||||
@@ -294,7 +320,19 @@ contract MixinSignatureValidator is
|
||||
signerAddress,
|
||||
signature
|
||||
);
|
||||
// bytes4 0x42b38674
|
||||
bytes32 magicValue = bytes32(bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)")));
|
||||
assembly {
|
||||
// extcodesize added as an extra safety measure
|
||||
if iszero(extcodesize(validatorAddress)) {
|
||||
// Revert with `Error("VALIDATOR_ERROR")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
let cdStart := add(callData, 32)
|
||||
let success := staticcall(
|
||||
gas, // forward all gas
|
||||
@@ -305,6 +343,15 @@ contract MixinSignatureValidator is
|
||||
32 // output size is 32 bytes
|
||||
)
|
||||
|
||||
if iszero(eq(returndatasize(), 32)) {
|
||||
// Revert with `Error("VALIDATOR_ERROR")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
switch success
|
||||
case 0 {
|
||||
// Revert with `Error("VALIDATOR_ERROR")`
|
||||
@@ -316,7 +363,10 @@ contract MixinSignatureValidator is
|
||||
}
|
||||
case 1 {
|
||||
// Signature is valid if call did not revert and returned true
|
||||
isValid := mload(cdStart)
|
||||
isValid := eq(
|
||||
and(mload(cdStart), 0xffffffff00000000000000000000000000000000000000000000000000000000),
|
||||
and(magicValue, 0xffffffff00000000000000000000000000000000000000000000000000000000)
|
||||
)
|
||||
}
|
||||
}
|
||||
return isValid;
|
||||
|
@@ -25,7 +25,8 @@ contract IValidator {
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param signerAddress Address that should have signed the given hash.
|
||||
/// @param signature Proof of signing.
|
||||
/// @return Validity of order signature.
|
||||
/// @return Magic bytes4 value if the signature is valid.
|
||||
/// Magic value is bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"))
|
||||
function isValidSignature(
|
||||
bytes32 hash,
|
||||
address signerAddress,
|
||||
@@ -33,5 +34,5 @@ contract IValidator {
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid);
|
||||
returns (bytes4);
|
||||
}
|
||||
|
@@ -24,12 +24,13 @@ contract IWallet {
|
||||
/// @dev Verifies that a signature is valid.
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param signature Proof of signing.
|
||||
/// @return Validity of order signature.
|
||||
/// @return Magic bytes4 value if the signature is valid.
|
||||
/// Magic value is bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"))
|
||||
function isValidSignature(
|
||||
bytes32 hash,
|
||||
bytes calldata signature
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid);
|
||||
returns (bytes4);
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange",
|
||||
"version": "2.1.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"
|
||||
|
@@ -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 () => {
|
||||
|
@@ -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,
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
},
|
||||
|
@@ -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,
|
||||
|
@@ -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,
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
},
|
||||
|
@@ -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",
|
||||
|
@@ -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
|
||||
|
@@ -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",
|
||||
|
@@ -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": [
|
||||
|
@@ -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)
|
||||
|
@@ -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
1
env/.Python
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/Python
|
84
env/bin/activate
vendored
Normal file
84
env/bin/activate
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
# This file must be used with "source bin/activate" *from bash*
|
||||
# you cannot run it directly
|
||||
|
||||
|
||||
if [ "${BASH_SOURCE-}" = "$0" ]; then
|
||||
echo "You must source this script: \$ source $0" >&2
|
||||
exit 33
|
||||
fi
|
||||
|
||||
deactivate () {
|
||||
unset -f pydoc >/dev/null 2>&1
|
||||
|
||||
# reset old environment variables
|
||||
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all
|
||||
if ! [ -z "${_OLD_VIRTUAL_PATH:+_}" ] ; then
|
||||
PATH="$_OLD_VIRTUAL_PATH"
|
||||
export PATH
|
||||
unset _OLD_VIRTUAL_PATH
|
||||
fi
|
||||
if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
|
||||
PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
|
||||
export PYTHONHOME
|
||||
unset _OLD_VIRTUAL_PYTHONHOME
|
||||
fi
|
||||
|
||||
# This should detect bash and zsh, which have a hash command that must
|
||||
# be called to get it to forget past commands. Without forgetting
|
||||
# past commands the $PATH changes we made may not be respected
|
||||
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
|
||||
hash -r 2>/dev/null
|
||||
fi
|
||||
|
||||
if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
|
||||
PS1="$_OLD_VIRTUAL_PS1"
|
||||
export PS1
|
||||
unset _OLD_VIRTUAL_PS1
|
||||
fi
|
||||
|
||||
unset VIRTUAL_ENV
|
||||
if [ ! "${1-}" = "nondestructive" ] ; then
|
||||
# Self destruct!
|
||||
unset -f deactivate
|
||||
fi
|
||||
}
|
||||
|
||||
# unset irrelevant variables
|
||||
deactivate nondestructive
|
||||
|
||||
VIRTUAL_ENV="/Users/jacob/projects/ethdev/0x/workspace-remote/workspace/0x-monorepo/env"
|
||||
export VIRTUAL_ENV
|
||||
|
||||
_OLD_VIRTUAL_PATH="$PATH"
|
||||
PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
export PATH
|
||||
|
||||
# unset PYTHONHOME if set
|
||||
if ! [ -z "${PYTHONHOME+_}" ] ; then
|
||||
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
|
||||
unset PYTHONHOME
|
||||
fi
|
||||
|
||||
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
|
||||
_OLD_VIRTUAL_PS1="${PS1-}"
|
||||
if [ "x" != x ] ; then
|
||||
PS1="${PS1-}"
|
||||
else
|
||||
PS1="(`basename \"$VIRTUAL_ENV\"`) ${PS1-}"
|
||||
fi
|
||||
export PS1
|
||||
fi
|
||||
|
||||
# Make sure to unalias pydoc if it's already there
|
||||
alias pydoc 2>/dev/null >/dev/null && unalias pydoc || true
|
||||
|
||||
pydoc () {
|
||||
python -m pydoc "$@"
|
||||
}
|
||||
|
||||
# This should detect bash and zsh, which have a hash command that must
|
||||
# be called to get it to forget past commands. Without forgetting
|
||||
# past commands the $PATH changes we made may not be respected
|
||||
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
|
||||
hash -r 2>/dev/null
|
||||
fi
|
55
env/bin/activate.csh
vendored
Normal file
55
env/bin/activate.csh
vendored
Normal 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
102
env/bin/activate.fish
vendored
Normal 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
67
env/bin/activate.ps1
vendored
Normal 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
46
env/bin/activate.xsh
vendored
Normal 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
46
env/bin/activate_this.py
vendored
Normal 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
10
env/bin/black
vendored
Executable 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
10
env/bin/blackd
vendored
Executable 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
10
env/bin/easy_install
vendored
Executable 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
10
env/bin/easy_install-3.7
vendored
Executable 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
10
env/bin/pip
vendored
Executable 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
10
env/bin/pip3
vendored
Executable 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
10
env/bin/pip3.7
vendored
Executable 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
1
env/bin/python
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
python3.7
|
78
env/bin/python-config
vendored
Executable file
78
env/bin/python-config
vendored
Executable 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
1
env/bin/python3
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
python3.7
|
BIN
env/bin/python3.7
vendored
Executable file
BIN
env/bin/python3.7
vendored
Executable file
Binary file not shown.
10
env/bin/wheel
vendored
Executable file
10
env/bin/wheel
vendored
Executable 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
1
env/include/python3.7m
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m
|
@@ -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",
|
||||
|
@@ -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",
|
||||
|
@@ -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
|
||||
|
@@ -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).
|
||||
|
||||
|
@@ -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",
|
||||
|
@@ -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,
|
||||
|
@@ -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": [
|
||||
|
@@ -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)
|
||||
|
@@ -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
|
||||
|
@@ -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}}
|
||||
)
|
@@ -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)
|
||||
|
@@ -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())
|
@@ -1,3 +1,3 @@
|
||||
{{#each inputs}}
|
||||
{{toPythonIdentifier name}}{{#if @last}}{{else}},{{/if}}
|
||||
{{/each}}
|
||||
{{toPythonIdentifier name}}{{#if @last}}{{else}}, {{/if~}}
|
||||
{{/each~}}
|
||||
|
@@ -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~}}
|
||||
|
@@ -1,3 +1,3 @@
|
||||
{{#each inputs}}
|
||||
{{toPythonIdentifier name}}: {{#parameterType type components}}{{/parameterType}},
|
||||
{{/each}}
|
||||
{{toPythonIdentifier name}}: {{#parameterType type components}}{{/parameterType}}{{^if @last}}, {{/if~}}
|
||||
{{/each~}}
|
||||
|
@@ -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,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-templates",
|
||||
"version": "2.4.0",
|
||||
"version": "2.4.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
|
@@ -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;
|
||||
},
|
||||
|
@@ -0,0 +1,5 @@
|
||||
{{#each inputs}}
|
||||
{{#if (getDocstringForParamTs name ../docstrings)}}
|
||||
{{formatDocstringForParamTs name (getDocstringForParamTs name ../docstrings)}}
|
||||
{{/if}}
|
||||
{{/each}}
|
@@ -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;
|
||||
}
|
||||
};
|
||||
|
@@ -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": [
|
||||
|
@@ -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)
|
||||
|
@@ -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)`.
|
||||
|
@@ -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
@@ -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,
|
||||
|
@@ -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,
|
||||
|
@@ -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
Reference in New Issue
Block a user