Compare commits
311 Commits
@0x/utils@
...
@0x/contra
Author | SHA1 | Date | |
---|---|---|---|
|
f570f80674 | ||
|
dbae6ec165 | ||
|
18084588ea | ||
|
64d99dc07c | ||
|
63a63543be | ||
|
75a4bbc5f2 | ||
|
c2ec4174b7 | ||
|
7ea274b731 | ||
|
d9675ad6d3 | ||
|
a8e32d8c87 | ||
|
16a2cf7be6 | ||
|
b4621f6a69 | ||
|
c859788fde | ||
|
1c25d8e997 | ||
|
fc89b97818 | ||
|
b0817854e8 | ||
|
1907ecc02e | ||
|
cf2dee60dc | ||
|
80aa2884a3 | ||
|
3a28eb1c6a | ||
|
82a44559f6 | ||
|
892be49b98 | ||
|
1cbc03ae43 | ||
|
1c9a49cd08 | ||
|
4f53335db0 | ||
|
0b87aec9c6 | ||
|
6892f929fb | ||
|
f39c03191c | ||
|
05adb38a09 | ||
|
f73c68ee61 | ||
|
33f3405226 | ||
|
86caa4a0bb | ||
|
6d832deb62 | ||
|
0b6c9c8468 | ||
|
d1fd4421be | ||
|
b06f8239e1 | ||
|
7991de9ed0 | ||
|
e9a82905e3 | ||
|
f8684d6a77 | ||
|
e4551c8f60 | ||
|
2f1454e90e | ||
|
b89f986949 | ||
|
285fb3dead | ||
|
923234eed1 | ||
|
83b46cbf71 | ||
|
4689309857 | ||
|
02543fdd0c | ||
|
1f7179b178 | ||
|
e14f1646d6 | ||
|
caba2faa92 | ||
|
ed3b89f005 | ||
|
1c279f97ce | ||
|
b41bcd80ef | ||
|
45d70dd30b | ||
|
4b9648c7c9 | ||
|
092a851bb3 | ||
|
bd71f4a480 | ||
|
bf183af9a4 | ||
|
2b8f0d887a | ||
|
2581bc93e5 | ||
|
8b62783f48 | ||
|
2345a3bdfe | ||
|
ab5cd8f938 | ||
|
b108b1119a | ||
|
b5420fde52 | ||
|
dc58c60841 | ||
|
043fb3f460 | ||
|
34cce04c43 | ||
|
6aae0c5b78 | ||
|
c15406173a | ||
|
e3b3f82c8c | ||
|
007a2d7deb | ||
|
5da40ab45e | ||
|
54a1fd87db | ||
|
797d7c7878 | ||
|
507c47c42c | ||
|
7fcdfe5de5 | ||
|
22b1c48c89 | ||
|
2197a531e3 | ||
|
4799b68972 | ||
|
500d8fc86b | ||
|
89c5d657a7 | ||
|
bc44774116 | ||
|
943c378309 | ||
|
cf3787edbb | ||
|
89429c54a7 | ||
|
bb992458a3 | ||
|
66add14ca5 | ||
|
0b38513c3f | ||
|
d9ac5b611a | ||
|
e1b99b5e2f | ||
|
7af0818dff | ||
|
296b3d6311 | ||
|
4d03c3035c | ||
|
27c4d2522b | ||
|
4dbd3ea902 | ||
|
2cf57a48dd | ||
|
a091b2c19d | ||
|
89e398fa39 | ||
|
a5b7a35160 | ||
|
53fc860d61 | ||
|
749312c0e8 | ||
|
ffd14ab2f2 | ||
|
bf332d578c | ||
|
6c22594882 | ||
|
b8e3829fdb | ||
|
c317a69e7e | ||
|
4c60d59123 | ||
|
cee2954245 | ||
|
a8d9263062 | ||
|
7ae9e79235 | ||
|
15c9479ebe | ||
|
03dea585b4 | ||
|
d7df402c42 | ||
|
052ed21e9c | ||
|
36504646f9 | ||
|
60cdbbccae | ||
|
420333e3c3 | ||
|
b639843115 | ||
|
7a114a6ef1 | ||
|
686f27a96f | ||
|
6487fae113 | ||
|
87c287a5e2 | ||
|
e39ef60775 | ||
|
fb3605026e | ||
|
5b8c9122a2 | ||
|
08d0ff48c3 | ||
|
aa5af04447 | ||
|
39786c3ad5 | ||
|
7f2727236d | ||
|
d6644ed035 | ||
|
a2eede2ec9 | ||
|
ea14913b41 | ||
|
5868c91cfb | ||
|
fd034cc1e4 | ||
|
d00dd07435 | ||
|
16fc2c3776 | ||
|
82f29c395a | ||
|
03248244ff | ||
|
f05d2906e8 | ||
|
2c974b5f3f | ||
|
f412c36e23 | ||
|
eae255b0ff | ||
|
1f0f2076a9 | ||
|
80f1fe1373 | ||
|
571bc736e5 | ||
|
99016cc5a6 | ||
|
f1a7efc97e | ||
|
442de09bbe | ||
|
76dde294f1 | ||
|
edb3a61387 | ||
|
89f67b9bec | ||
|
9131ca1562 | ||
|
92d45a19d1 | ||
|
65af195054 | ||
|
9f47f90c6e | ||
|
472f89bd3d | ||
|
f17fe381bf | ||
|
26977f6408 | ||
|
c8c8219c05 | ||
|
e144ebbb93 | ||
|
aa9aa1f58a | ||
|
2e2e157fc8 | ||
|
219902a169 | ||
|
ab10119c5a | ||
|
5981823ac1 | ||
|
69054d85e8 | ||
|
3e596f6a8c | ||
|
c3884dfa32 | ||
|
a3d93d17cd | ||
|
c6c45095a8 | ||
|
21d9783ef8 | ||
|
89ce87f9f1 | ||
|
592e1a3e6f | ||
|
99176c2d54 | ||
|
ad0083dfa0 | ||
|
6919409c2b | ||
|
f360b2edd6 | ||
|
339ec3e8eb | ||
|
b0c22a222e | ||
|
ea18050589 | ||
|
117726c6d8 | ||
|
31d07fdac8 | ||
|
881655bb57 | ||
|
38949f7ea4 | ||
|
8d3e6f77b7 | ||
|
5865d1f62c | ||
|
e2607980eb | ||
|
f519f5744e | ||
|
fa24ec1a04 | ||
|
6e1014a647 | ||
|
0b46f44ad3 | ||
|
b811b51af9 | ||
|
b88e2c5483 | ||
|
cd333e0977 | ||
|
62706d83c4 | ||
|
284252e7a4 | ||
|
3ad857be6c | ||
|
7fec2f630c | ||
|
c081081448 | ||
|
54bd7df900 | ||
|
5afef5fe82 | ||
|
0c222f9890 | ||
|
e43988aa44 | ||
|
ee91f56bbe | ||
|
52b49fee24 | ||
|
31f096248d | ||
|
d91c41b29c | ||
|
c27a2b64ef | ||
|
fdaffb67e8 | ||
|
d32bf15b69 | ||
|
7536648f7a | ||
|
eb2fa8e4af | ||
|
5d3d2736f5 | ||
|
0574794496 | ||
|
3a23e795ac | ||
|
2dfca078fd | ||
|
9006e8fced | ||
|
6b8f8580d8 | ||
|
eb9d802146 | ||
|
6b11ca6c1d | ||
|
4c8178fc30 | ||
|
4616d6f59d | ||
|
5cb944fe1b | ||
|
50c4909f22 | ||
|
dd8b9bf987 | ||
|
0e3cd82348 | ||
|
3d4041ecd3 | ||
|
89e439c521 | ||
|
0f97771d5a | ||
|
74f0515370 | ||
|
f17c7e4a22 | ||
|
5fe98c816d | ||
|
f75cfd8aa4 | ||
|
7577d96671 | ||
|
58f5b6d0ad | ||
|
a11348ce6b | ||
|
a4825d8748 | ||
|
e3c0363db1 | ||
|
3fdc6e5e47 | ||
|
2ef8204ab4 | ||
|
72b4ee76fb | ||
|
3901380ffb | ||
|
fb24a18f3f | ||
|
1899493ca8 | ||
|
1581ced6ec | ||
|
5e8f53c7b7 | ||
|
370d15ed1d | ||
|
43b792f307 | ||
|
b844126516 | ||
|
43e55a963b | ||
|
9cf055c159 | ||
|
16b5157078 | ||
|
1ae9f68db8 | ||
|
e5d3e3b33a | ||
|
1c8ea1336e | ||
|
a4de585feb | ||
|
e624759bc7 | ||
|
0836ab370e | ||
|
66848ef80f | ||
|
f0b9365ca9 | ||
|
614ca51cb1 | ||
|
f31f9eb24e | ||
|
bc029df082 | ||
|
63b53acd48 | ||
|
50eee9a657 | ||
|
917952bc2a | ||
|
00afb2440d | ||
|
8cf720986e | ||
|
97c54f84f0 | ||
|
e485a98143 | ||
|
1e29f2875d | ||
|
61cd36cc96 | ||
|
a9b4c1cba8 | ||
|
5187017f21 | ||
|
73ea2dac6d | ||
|
e9232bf070 | ||
|
ee3538262d | ||
|
47b281b754 | ||
|
dfa03feb43 | ||
|
49beb6b7a3 | ||
|
6066db8f42 | ||
|
68c1818139 | ||
|
12087b6b70 | ||
|
15a3c234c5 | ||
|
bf7443c985 | ||
|
6c39d498c2 | ||
|
cacb8acf76 | ||
|
c1082b9b08 | ||
|
d3c5c68296 | ||
|
39fd3fd866 | ||
|
7ed95d3954 | ||
|
4dc91c86ae | ||
|
7d7f54c751 | ||
|
580e574c84 | ||
|
736e1717fa | ||
|
d6ac1a4f78 | ||
|
8a7c61c6f4 | ||
|
9a024fdacf | ||
|
135a623b1f | ||
|
ba0b9b259f | ||
|
45a24738b5 | ||
|
585ca203b0 | ||
|
561f441a5b | ||
|
30f7f83573 | ||
|
97646571a1 | ||
|
ac60d45969 | ||
|
afa52e280c | ||
|
c57c9752a2 | ||
|
b158a6d722 | ||
|
c616b53c9c |
@@ -4,7 +4,7 @@ jobs:
|
||||
build:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9
|
||||
- image: circleci/node:9-browsers
|
||||
environment:
|
||||
CONTRACTS_COMMIT_HASH: '9ed05f5'
|
||||
working_directory: ~/repo
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
command: sudo npm install --global yarn@1.9.4
|
||||
- run:
|
||||
name: yarn
|
||||
command: yarn --frozen-lockfile install || yarn --frozen-lockfile install
|
||||
command: yarn --frozen-lockfile --ignore-engines install
|
||||
- run: yarn build:ci:no_website
|
||||
- run: yarn build:ts
|
||||
- save_cache:
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
build-website:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9
|
||||
- image: circleci/node:9-browsers
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
- run: cd packages/website && yarn build:prod
|
||||
test-contracts-ganache:
|
||||
docker:
|
||||
- image: circleci/node:9
|
||||
- image: circleci/node:9-browsers
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
- run: yarn wsrun test:circleci @0x/contracts-protocol
|
||||
test-contracts-geth:
|
||||
docker:
|
||||
- image: circleci/node:9
|
||||
- image: circleci/node:9-browsers
|
||||
- image: 0xorg/devnet
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
test-publish:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9
|
||||
- image: circleci/node:9-browsers
|
||||
- image: 0xorg/verdaccio
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
- run: yarn test:publish:circleci
|
||||
test-doc-generation:
|
||||
docker:
|
||||
- image: circleci/node:9
|
||||
- image: circleci/node:9-browsers
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
- ~/repo/packages/pipeline/coverage/lcov.info
|
||||
test-rest:
|
||||
docker:
|
||||
- image: circleci/node:9
|
||||
- image: circleci/node:9-browsers
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
- 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-cov
|
||||
- run: yarn wsrun test:circleci @0x/sol-tracing-utils
|
||||
- run: yarn wsrun test:circleci @0x/sol-doc
|
||||
- run: yarn wsrun test:circleci @0x/subproviders
|
||||
- run: yarn wsrun test:circleci @0x/web3-wrapper
|
||||
@@ -169,9 +169,9 @@ jobs:
|
||||
paths:
|
||||
- ~/repo/packages/sol-compiler/coverage/lcov.info
|
||||
- save_cache:
|
||||
key: coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
|
||||
key: coverage-sol-tracing-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/sol-cov/coverage/lcov.info
|
||||
- ~/repo/packages/sol-tracing-utils/coverage/lcov.info
|
||||
- save_cache:
|
||||
key: coverage-sol-doc-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
@@ -200,46 +200,30 @@ jobs:
|
||||
key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages/json_schemas
|
||||
cd python-packages
|
||||
python -m ensurepip
|
||||
python -m pip install .[dev]
|
||||
# HACK! installing the package should do the following
|
||||
# copy for us, but it's not working in CircleCI for some
|
||||
# reason. Zendesk support ticket raised (#43979) with
|
||||
# CircleCI.
|
||||
mkdir /usr/local/lib/python3.7/site-packages/zero_ex/json_schemas/schemas
|
||||
cp -R src/zero_ex/json_schemas/schemas/* /usr/local/lib/python3.7/site-packages/zero_ex/json_schemas/schemas
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages/order_utils
|
||||
python -m ensurepip
|
||||
python -m pip install .[dev]
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages/sra_client
|
||||
python -m ensurepip
|
||||
python -m pip install .[dev]
|
||||
./install
|
||||
- save_cache:
|
||||
key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- '/usr/local/bin'
|
||||
- '/usr/local/lib/python3.7/site-packages'
|
||||
- '.eggs'
|
||||
- '.mypy_cache'
|
||||
- '.pytest_cache'
|
||||
- '.tox'
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages/json_schemas
|
||||
coverage run setup.py test
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages/order_utils
|
||||
coverage run setup.py test
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages/sra_client
|
||||
coverage run setup.py test
|
||||
cd python-packages
|
||||
./cmd_pkgs_in_dep_order.py coverage run setup.py test
|
||||
- save_cache:
|
||||
key: coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/python-packages/contract_addresses/.coverage
|
||||
- save_cache:
|
||||
key: coverage-python-contract-artifacts-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/python-packages/contract_artifacts/.coverage
|
||||
- save_cache:
|
||||
key: coverage-python-contract-demo-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/python-packages/contract_demo/.coverage
|
||||
- save_cache:
|
||||
key: coverage-python-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
@@ -292,31 +276,14 @@ jobs:
|
||||
key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages/json_schemas
|
||||
python -m ensurepip
|
||||
python -m pip install .[dev]
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages/order_utils
|
||||
python -m ensurepip
|
||||
python -m pip install .[dev]
|
||||
- save_cache:
|
||||
key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- '/usr/local/bin'
|
||||
- '/usr/local/lib/python3.7/site-packages'
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages/json_schemas
|
||||
python setup.py lint
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages/order_utils
|
||||
python setup.py lint
|
||||
cd python-packages
|
||||
./install
|
||||
./lint
|
||||
static-tests:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/node:9
|
||||
- image: circleci/node:9-browsers
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
@@ -327,7 +294,7 @@ jobs:
|
||||
- run: yarn bundlewatch
|
||||
submit-coverage:
|
||||
docker:
|
||||
- image: circleci/node:9
|
||||
- image: circleci/node:9-browsers
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -368,7 +335,7 @@ jobs:
|
||||
- coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- coverage-sol-tracing-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-sol-doc-{{ .Environment.CIRCLE_SHA1 }}
|
||||
@@ -384,6 +351,18 @@ jobs:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-python-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-python-contract-artifacts-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-python-contract-demo-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-python-sra-client-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-python-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||
@@ -421,7 +400,9 @@ workflows:
|
||||
requires:
|
||||
- test-rest
|
||||
- test-python
|
||||
- static-tests-python:
|
||||
requires:
|
||||
- test-python
|
||||
- test-python
|
||||
- static-tests-python
|
||||
# skip python tox run for now, as we don't yet have multiple test environments to support.
|
||||
#- test-rest-python
|
||||
|
5
.github/autolabeler.yml
vendored
5
.github/autolabeler.yml
vendored
@@ -13,7 +13,10 @@ instant: ['packages/instant']
|
||||
abi-gen-templates: ['packages/abi-gen-templates']
|
||||
abi-gen: ['packages/abi-gen']
|
||||
website: ['packages/website']
|
||||
sol-cov: ['packages/sol-cov']
|
||||
sol-coverage: ['packages/sol-coverage']
|
||||
sol-profiler: ['packages/sol-profiler']
|
||||
sol-trace: ['packages/sol-trace']
|
||||
sol-tracing-utils: ['packages/sol-tracing-utils']
|
||||
utils: ['packages/utils']
|
||||
tslint-config: ['packages/tslint-config']
|
||||
asset-buyer: ['packages/asset-buyer']
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -91,7 +91,7 @@ contracts/interfaces/generated-artifacts/
|
||||
contracts/tokens/generated-artifacts/
|
||||
contracts/examples/generated-artifacts/
|
||||
contracts/extensions/generated-artifacts/
|
||||
packages/sol-cov/test/fixtures/artifacts/
|
||||
packages/sol-tracing-utils/test/fixtures/artifacts/
|
||||
packages/metacoin/artifacts/
|
||||
|
||||
# generated contract wrappers
|
||||
|
@@ -18,15 +18,16 @@ lib
|
||||
/contracts/extensions/generated-artifacts
|
||||
/packages/abi-gen-wrappers/src/generated-wrappers
|
||||
/packages/contract-artifacts/artifacts
|
||||
/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts
|
||||
/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts
|
||||
/packages/json-schemas/schemas
|
||||
/python-packages/json_schemas/src/zero_ex/json_schemas/schemas
|
||||
/packages/metacoin/src/contract_wrappers
|
||||
/packages/metacoin/artifacts
|
||||
/packages/sra-spec/public/
|
||||
/packages/dev-tools-pages/ts/**/data.json
|
||||
package.json
|
||||
scripts/postpublish_utils.js
|
||||
packages/sol-cov/test/fixtures/artifacts
|
||||
packages/sol-coverage/test/fixtures/artifacts
|
||||
.pytest_cache
|
||||
.mypy_cache
|
||||
.tox
|
||||
|
@@ -24,7 +24,10 @@ packages/metacoin/ @LogvinovLeon
|
||||
packages/monorepo-scripts/ @fabioberger
|
||||
packages/order-utils/ @fabioberger @LogvinovLeon
|
||||
packages/sol-compiler/ @LogvinovLeon
|
||||
packages/sol-cov/ @LogvinovLeon
|
||||
packages/sol-coverage/ @LogvinovLeon
|
||||
packages/sol-profiler/ @LogvinovLeon
|
||||
packages/sol-trace/ @LogvinovLeon
|
||||
packages/sol-tracing-utils/ @LogvinovLeon
|
||||
packages/sol-resolver/ @LogvinovLeon
|
||||
packages/subproviders/ @fabioberger @dekz
|
||||
packages/verdaccio/ @albrow
|
||||
|
@@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
|
@@ -12,26 +12,26 @@ We welcome contributions from anyone on the internet and are grateful for even t
|
||||
|
||||
Before removing the `[WIP]` tag and submitting the PR for review, make sure:
|
||||
|
||||
* It passes our linter checks (`yarn lint`)
|
||||
* It is properly formatted with Prettier (`yarn prettier`)
|
||||
* It passes our continuous integration tests (See: [Enabling code coverage checks on your fork](#enabling-code-coverage-checks-on-your-fork) for instructions on getting the `submit-coverage` test to pass on forks)
|
||||
* You've created/updated the corresponding [CHANGELOG](#CHANGELOGs) entries.
|
||||
* Your changes have sufficient test coverage (e.g regression tests have been added for bug fixes)
|
||||
- It passes our linter checks (`yarn lint`)
|
||||
- It is properly formatted with Prettier (`yarn prettier`)
|
||||
- It passes our continuous integration tests (See: [Enabling code coverage checks on your fork](#enabling-code-coverage-checks-on-your-fork) for instructions on getting the `submit-coverage` test to pass on forks)
|
||||
- You've created/updated the corresponding [CHANGELOG](#CHANGELOGs) entries.
|
||||
- Your changes have sufficient test coverage (e.g regression tests have been added for bug fixes)
|
||||
|
||||
### Branch structure
|
||||
|
||||
We have two main branches:
|
||||
|
||||
* `master` represents the most recently released (published on npm) version of the codebase.
|
||||
* `development` represents the current development state of the codebase.
|
||||
- `master` represents the most recently released (published on npm) version of the codebase.
|
||||
- `development` represents the current development state of the codebase.
|
||||
|
||||
ALL PRs should be opened against `development`.
|
||||
|
||||
Branch names should be prefixed with `fix`, `feature` or `refactor`.
|
||||
|
||||
* e.g `fix/broken-wiki-link`
|
||||
* If the PR only edits a single package, add it's name too
|
||||
* e.g `fix/website/broken-wiki-link`
|
||||
- e.g `fix/broken-wiki-link`
|
||||
- If the PR only edits a single package, add it's name too
|
||||
- e.g `fix/website/broken-wiki-link`
|
||||
|
||||
### CHANGELOGs
|
||||
|
||||
@@ -67,8 +67,8 @@ If you want to change a rule, or add a custom rule, please make these changes to
|
||||
|
||||
Integrate it into your text editor:
|
||||
|
||||
* VSCode: [vscode-tslint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint)
|
||||
* Atom: [linter-tslint](https://atom.io/packages/linter-tslint)
|
||||
- VSCode: [vscode-tslint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint)
|
||||
- Atom: [linter-tslint](https://atom.io/packages/linter-tslint)
|
||||
|
||||
#### Auto-formatter
|
||||
|
||||
@@ -76,8 +76,8 @@ We use [Prettier](https://prettier.io/) to auto-format our code. Be sure to eith
|
||||
|
||||
If using the Atom text editor, we recommend you install the following packages:
|
||||
|
||||
* VSCode: [prettier-vscode](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
|
||||
* Atom: [prettier-atom](https://atom.io/packages/prettier-atom)
|
||||
- VSCode: [prettier-vscode](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
|
||||
- Atom: [prettier-atom](https://atom.io/packages/prettier-atom)
|
||||
|
||||
## Unenforced coding conventions
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
<!--- The following points should be used to indicate the progress of your PR. Put an `x` in all the boxes that apply right now, and come back over time and check them off as you make progress. If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
||||
|
||||
* [ ] Prefix PR title with `[WIP]` if necessary.
|
||||
* [ ] Add tests to cover changes as needed.
|
||||
* [ ] Update documentation as needed.
|
||||
* [ ] Add new entries to the relevant CHANGELOG.jsons.
|
||||
- [ ] Prefix PR title with `[WIP]` if necessary.
|
||||
- [ ] Add tests to cover changes as needed.
|
||||
- [ ] Update documentation as needed.
|
||||
- [ ] Add new entries to the relevant CHANGELOG.jsons.
|
||||
|
16
README.md
16
README.md
@@ -24,11 +24,13 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
|
||||
|
||||
### Python Packages
|
||||
|
||||
| Package | Version | Description |
|
||||
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| [`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 |
|
||||
| Package | Version | Description |
|
||||
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| [`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-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 |
|
||||
|
||||
### Typescript/Javascript Packages
|
||||
|
||||
@@ -55,7 +57,9 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
|
||||
| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [`@0x/web3-wrapper`](/packages/web3-wrapper) | [](https://www.npmjs.com/package/@0x/web3-wrapper) | An Ethereum JSON RPC client |
|
||||
| [`@0x/sol-compiler`](/packages/sol-compiler) | [](https://www.npmjs.com/package/@0x/sol-compiler) | A wrapper around solc-js that adds smart re-compilation, ability to compile an entire project, Solidity version specific compilation, standard input description support and much more. |
|
||||
| [`@0x/sol-cov`](/packages/sol-cov) | [](https://www.npmjs.com/package/@0x/sol-cov) | A solidity test coverage tool |
|
||||
| [`@0x/sol-coverage`](/packages/sol-coverage) | [](https://www.npmjs.com/package/@0x/sol-coverage) | A solidity test coverage tool |
|
||||
| [`@0x/sol-profiler`](/packages/sol-profiler) | [](https://www.npmjs.com/package/@0x/sol-profiler) | A solidity gas cost profiler |
|
||||
| [`@0x/sol-trace`](/packages/sol-trace) | [](https://www.npmjs.com/package/@0x/sol-trace) | A solidity stack trace tool |
|
||||
| [`@0x/sol-resolver`](/packages/sol-resolver) | [](https://www.npmjs.com/package/@0x/sol-resolver) | Import resolver for smart contracts dependencies |
|
||||
| [`@0x/subproviders`](/packages/subproviders) | [](https://www.npmjs.com/package/@0x/subproviders) | Web3 provider middlewares (e.g. LedgerSubprovider) |
|
||||
| [`@0x/sol-doc`](/packages/sol-doc) | [](https://www.npmjs.com/package/@0x/sol-doc) | Solidity documentation generator |
|
||||
|
@@ -20,7 +20,7 @@ TEST_PROVIDER=geth yarn test
|
||||
|
||||
## Code coverage
|
||||
|
||||
In order to see the Solidity code coverage output generated by `@0x/sol-cov`, run:
|
||||
In order to see the Solidity code coverage output generated by `@0x/sol-coverage`, run:
|
||||
|
||||
```
|
||||
yarn test:coverage
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "1.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "1.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547040760,
|
||||
"version": "1.0.3",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.5 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.4 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.3 - _January 9, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-examples",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -33,13 +33,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/examples/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.20",
|
||||
"@0x/contracts-test-utils": "^1.0.3",
|
||||
"@0x/dev-utils": "^1.0.22",
|
||||
"@0x/sol-compiler": "^2.0.0",
|
||||
"@0x/sol-cov": "^2.1.17",
|
||||
"@0x/subproviders": "^2.1.9",
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/abi-gen": "^1.0.22",
|
||||
"@0x/contracts-test-utils": "^2.0.0",
|
||||
"@0x/dev-utils": "^1.0.24",
|
||||
"@0x/sol-compiler": "^2.0.2",
|
||||
"@0x/subproviders": "^2.1.11",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -59,20 +58,20 @@
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^3.0.11",
|
||||
"@0x/contracts-interfaces": "^1.0.3",
|
||||
"@0x/contracts-libs": "^1.0.3",
|
||||
"@0x/contracts-multisig": "^1.0.3",
|
||||
"@0x/contracts-tokens": "^1.0.3",
|
||||
"@0x/contracts-utils": "^1.0.3",
|
||||
"@0x/order-utils": "^3.1.0",
|
||||
"@0x/types": "^1.5.0",
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/web3-wrapper": "^3.2.2",
|
||||
"@0x/base-contract": "^3.0.13",
|
||||
"@0x/contracts-interfaces": "^1.0.5",
|
||||
"@0x/contracts-libs": "^1.0.5",
|
||||
"@0x/contracts-multisig": "^1.0.5",
|
||||
"@0x/contracts-tokens": "^1.0.5",
|
||||
"@0x/contracts-utils": "^1.0.5",
|
||||
"@0x/order-utils": "^3.1.2",
|
||||
"@0x/types": "^1.5.2",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"@0x/web3-wrapper": "^3.2.4",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "1.2.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "1.2.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.2.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.2.2 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.2.1 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.2.0 - _January 9, 2019_
|
||||
|
||||
* Added Dutch Auction Wrapper (#1465)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-extensions",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,14 +44,13 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.20",
|
||||
"@0x/contract-wrappers": "^4.2.0",
|
||||
"@0x/contracts-test-utils": "^1.0.3",
|
||||
"@0x/dev-utils": "^1.0.22",
|
||||
"@0x/sol-compiler": "^2.0.0",
|
||||
"@0x/sol-cov": "^2.1.17",
|
||||
"@0x/subproviders": "^2.1.9",
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/abi-gen": "^1.0.22",
|
||||
"@0x/contract-wrappers": "^5.0.0",
|
||||
"@0x/contracts-test-utils": "^2.0.0",
|
||||
"@0x/dev-utils": "^1.0.24",
|
||||
"@0x/sol-compiler": "^2.0.2",
|
||||
"@0x/subproviders": "^2.1.11",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -71,20 +70,20 @@
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^3.0.11",
|
||||
"@0x/contracts-interfaces": "^1.0.3",
|
||||
"@0x/contracts-libs": "^1.0.3",
|
||||
"@0x/contracts-protocol": "^2.2.0",
|
||||
"@0x/contracts-tokens": "^1.0.3",
|
||||
"@0x/contracts-utils": "^1.0.3",
|
||||
"@0x/order-utils": "^3.1.0",
|
||||
"@0x/types": "^1.5.0",
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/web3-wrapper": "^3.2.2",
|
||||
"@0x/base-contract": "^3.0.13",
|
||||
"@0x/contracts-interfaces": "^1.0.5",
|
||||
"@0x/contracts-libs": "^1.0.5",
|
||||
"@0x/contracts-protocol": "^2.2.2",
|
||||
"@0x/contracts-tokens": "^1.0.5",
|
||||
"@0x/contracts-utils": "^1.0.5",
|
||||
"@0x/order-utils": "^3.1.2",
|
||||
"@0x/types": "^1.5.2",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"@0x/web3-wrapper": "^3.2.4",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -1457,7 +1457,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
const orderInfoBeforeCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync(
|
||||
validSignedOrder,
|
||||
);
|
||||
expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
// Cancel
|
||||
const txReceipt = await erc721MakerBalanceThresholdWrapper.cancelOrderAsync(
|
||||
validSignedOrder,
|
||||
@@ -1470,7 +1470,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
const orderInfoAfterCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync(
|
||||
validSignedOrder,
|
||||
);
|
||||
expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED);
|
||||
expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled);
|
||||
});
|
||||
it('Should successfully cancel order if maker does not meet balance threshold', async () => {
|
||||
// Create order where maker does not meet balance threshold
|
||||
@@ -1479,7 +1479,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
const orderInfoBeforeCancelling = await erc721NonValidBalanceThresholdWrapper.getOrderInfoAsync(
|
||||
signedOrderWithBadMakerAddress,
|
||||
);
|
||||
expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
// Cancel
|
||||
const txReceipt = await erc721NonValidBalanceThresholdWrapper.cancelOrderAsync(
|
||||
signedOrderWithBadMakerAddress,
|
||||
@@ -1492,7 +1492,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
const orderInfoAfterCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync(
|
||||
signedOrderWithBadMakerAddress,
|
||||
);
|
||||
expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED);
|
||||
expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1512,7 +1512,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
const orderInfoBeforeCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync(
|
||||
signedOrder,
|
||||
);
|
||||
return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
});
|
||||
// Cancel
|
||||
const txReceipt = await erc721MakerBalanceThresholdWrapper.batchCancelOrdersAsync(
|
||||
@@ -1527,7 +1527,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
const orderInfoAfterCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync(
|
||||
signedOrder,
|
||||
);
|
||||
return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED);
|
||||
return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled);
|
||||
});
|
||||
});
|
||||
it('Should successfully batch cancel order if maker does not meet balance threshold', async () => {
|
||||
@@ -1542,7 +1542,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
const orderInfoBeforeCancelling = await erc721NonValidBalanceThresholdWrapper.getOrderInfoAsync(
|
||||
signedOrder,
|
||||
);
|
||||
return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
});
|
||||
// Cancel
|
||||
const txReceipt = await erc721NonValidBalanceThresholdWrapper.batchCancelOrdersAsync(
|
||||
@@ -1557,7 +1557,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
const orderInfoAfterCancelling = await erc721NonValidBalanceThresholdWrapper.getOrderInfoAsync(
|
||||
signedOrder,
|
||||
);
|
||||
return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED);
|
||||
return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1578,7 +1578,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
const orderInfoBeforeCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync(
|
||||
signedOrder,
|
||||
);
|
||||
return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
});
|
||||
// Cancel
|
||||
const cancelOrdersUpToThisSalt = new BigNumber(1);
|
||||
@@ -1596,9 +1596,9 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
);
|
||||
const saltAsBigNumber = new BigNumber(salt);
|
||||
if (saltAsBigNumber.lessThanOrEqualTo(cancelOrdersUpToThisSalt)) {
|
||||
return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED);
|
||||
return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled);
|
||||
} else {
|
||||
return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1614,7 +1614,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
const orderInfoBeforeCancelling = await erc721NonValidBalanceThresholdWrapper.getOrderInfoAsync(
|
||||
signedOrder,
|
||||
);
|
||||
return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
});
|
||||
// Cancel
|
||||
const cancelOrdersUpToThisSalt = new BigNumber(1);
|
||||
@@ -1632,9 +1632,9 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
||||
);
|
||||
const saltAsBigNumber = new BigNumber(salt);
|
||||
if (saltAsBigNumber.lessThanOrEqualTo(cancelOrdersUpToThisSalt)) {
|
||||
return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED);
|
||||
return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled);
|
||||
} else {
|
||||
return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@@ -432,7 +432,7 @@ describe('OrderValidator', () => {
|
||||
takerAddress,
|
||||
);
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
expect(orderInfo.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT);
|
||||
expect(traderInfo.makerBalance).to.be.bignumber.equal(constants.ZERO_AMOUNT);
|
||||
@@ -485,7 +485,7 @@ describe('OrderValidator', () => {
|
||||
takerAddress,
|
||||
);
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
expect(orderInfo.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT);
|
||||
expect(traderInfo.makerBalance).to.be.bignumber.equal(makerBalance);
|
||||
@@ -514,10 +514,10 @@ describe('OrderValidator', () => {
|
||||
] = await orderValidator.getOrdersAndTradersInfo.callAsync(orders, takers);
|
||||
const expectedOrderHash1 = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedOrderHash2 = orderHashUtils.getOrderHashHex(signedOrder2);
|
||||
expect(orderInfo1.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
expect(orderInfo1.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
expect(orderInfo1.orderHash).to.be.equal(expectedOrderHash1);
|
||||
expect(orderInfo1.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT);
|
||||
expect(orderInfo2.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
expect(orderInfo2.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
expect(orderInfo2.orderHash).to.be.equal(expectedOrderHash2);
|
||||
expect(orderInfo2.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT);
|
||||
expect(traderInfo1.makerBalance).to.be.bignumber.equal(constants.ZERO_AMOUNT);
|
||||
@@ -581,10 +581,10 @@ describe('OrderValidator', () => {
|
||||
] = await orderValidator.getOrdersAndTradersInfo.callAsync(orders, takers);
|
||||
const expectedOrderHash1 = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedOrderHash2 = orderHashUtils.getOrderHashHex(signedOrder2);
|
||||
expect(orderInfo1.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
expect(orderInfo1.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
expect(orderInfo1.orderHash).to.be.equal(expectedOrderHash1);
|
||||
expect(orderInfo1.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT);
|
||||
expect(orderInfo2.orderStatus).to.be.equal(OrderStatus.FILLABLE);
|
||||
expect(orderInfo2.orderStatus).to.be.equal(OrderStatus.Fillable);
|
||||
expect(orderInfo2.orderHash).to.be.equal(expectedOrderHash2);
|
||||
expect(orderInfo2.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT);
|
||||
expect(traderInfo1.makerBalance).to.be.bignumber.equal(makerBalance);
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "1.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "1.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547040760,
|
||||
"version": "1.0.3",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.5 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.4 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.3 - _January 9, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -6,8 +6,8 @@ Smart contract interfaces of the 0x protocol.
|
||||
|
||||
Contracts that make up and interact with version 2.0.0 of the protocol can be found in the [contracts](./contracts) directory. The contents of this directory are broken down into the following subdirectories:
|
||||
|
||||
* [protocol](./contracts/protocol)
|
||||
* This directory contains the contract interfaces that make up version 2.0.0. A full specification can be found [here](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md).
|
||||
- [protocol](./contracts/protocol)
|
||||
- This directory contains the contract interfaces that make up version 2.0.0. A full specification can be found [here](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md).
|
||||
|
||||
## Bug bounty
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-interfaces",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -30,9 +30,9 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/interfaces/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.20",
|
||||
"@0x/sol-compiler": "^2.0.0",
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/abi-gen": "^1.0.22",
|
||||
"@0x/sol-compiler": "^2.0.2",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"solhint": "^1.4.1",
|
||||
@@ -41,14 +41,14 @@
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^3.0.11",
|
||||
"@0x/contracts-libs": "^1.0.3",
|
||||
"@0x/contracts-utils": "^1.0.3",
|
||||
"@0x/types": "^1.5.0",
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/web3-wrapper": "^3.2.2",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"@0x/base-contract": "^3.0.13",
|
||||
"@0x/contracts-libs": "^1.0.5",
|
||||
"@0x/contracts-utils": "^1.0.5",
|
||||
"@0x/types": "^1.5.2",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"@0x/web3-wrapper": "^3.2.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "1.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "1.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547040760,
|
||||
"version": "1.0.3",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.5 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.4 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.3 - _January 9, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -6,10 +6,10 @@ Smart contracts libs used in the 0x protocol.
|
||||
|
||||
Contracts can be found in the [contracts](./contracts) directory. The contents of this directory are broken down into the following subdirectories:
|
||||
|
||||
* [libs](./contracts/protocol)
|
||||
* This directory contains the libs.
|
||||
* [test](./contracts/test)
|
||||
* This directory contains mocks and other contracts that are used solely for testing contracts within the other directories.
|
||||
- [libs](./contracts/protocol)
|
||||
- This directory contains the libs.
|
||||
- [test](./contracts/test)
|
||||
- This directory contains mocks and other contracts that are used solely for testing contracts within the other directories.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-libs",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,13 +44,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/libs/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.20",
|
||||
"@0x/contracts-test-utils": "^1.0.3",
|
||||
"@0x/dev-utils": "^1.0.22",
|
||||
"@0x/sol-compiler": "^2.0.0",
|
||||
"@0x/sol-cov": "^2.1.17",
|
||||
"@0x/subproviders": "^2.1.9",
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/abi-gen": "^1.0.22",
|
||||
"@0x/contracts-test-utils": "^2.0.0",
|
||||
"@0x/dev-utils": "^1.0.24",
|
||||
"@0x/sol-compiler": "^2.0.2",
|
||||
"@0x/subproviders": "^2.1.11",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -70,17 +69,17 @@
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^3.0.11",
|
||||
"@0x/contracts-multisig": "^1.0.3",
|
||||
"@0x/contracts-utils": "^1.0.3",
|
||||
"@0x/order-utils": "^3.1.0",
|
||||
"@0x/types": "^1.5.0",
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/web3-wrapper": "^3.2.2",
|
||||
"@0x/base-contract": "^3.0.13",
|
||||
"@0x/contracts-multisig": "^1.0.5",
|
||||
"@0x/contracts-utils": "^1.0.5",
|
||||
"@0x/order-utils": "^3.1.2",
|
||||
"@0x/types": "^1.5.2",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"@0x/web3-wrapper": "^3.2.4",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "1.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "1.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547040760,
|
||||
"version": "1.0.3",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.5 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.4 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.3 - _January 9, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -6,10 +6,10 @@ MultiSig smart contracts
|
||||
|
||||
Contracts can be found in the [contracts](./contracts) directory. The contents of this directory are broken down into the following subdirectories:
|
||||
|
||||
* [multisig](./contracts/multisig)
|
||||
* This directory contains the [Gnosis MultiSigWallet](https://github.com/gnosis/MultiSigWallet) and a custom extension that adds a timelock to transactions within the MultiSigWallet.
|
||||
* [test](./contracts/test)
|
||||
* This directory contains mocks and other contracts that are used solely for testing contracts within the other directories.
|
||||
- [multisig](./contracts/multisig)
|
||||
- This directory contains the [Gnosis MultiSigWallet](https://github.com/gnosis/MultiSigWallet) and a custom extension that adds a timelock to transactions within the MultiSigWallet.
|
||||
- [test](./contracts/test)
|
||||
- This directory contains mocks and other contracts that are used solely for testing contracts within the other directories.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-multisig",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,13 +44,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/multisig/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.20",
|
||||
"@0x/contracts-test-utils": "^1.0.3",
|
||||
"@0x/dev-utils": "^1.0.22",
|
||||
"@0x/sol-compiler": "^2.0.0",
|
||||
"@0x/sol-cov": "^2.1.17",
|
||||
"@0x/subproviders": "^2.1.9",
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/abi-gen": "^1.0.22",
|
||||
"@0x/contracts-test-utils": "^2.0.0",
|
||||
"@0x/dev-utils": "^1.0.24",
|
||||
"@0x/sol-compiler": "^2.0.2",
|
||||
"@0x/subproviders": "^2.1.11",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/ethereumjs-abi": "^0.6.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -70,13 +69,13 @@
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^3.0.11",
|
||||
"@0x/order-utils": "^3.1.0",
|
||||
"@0x/types": "^1.5.0",
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/web3-wrapper": "^3.2.2",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"@0x/base-contract": "^3.0.13",
|
||||
"@0x/order-utils": "^3.1.2",
|
||||
"@0x/types": "^1.5.2",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"@0x/web3-wrapper": "^3.2.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "2.2.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "2.2.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.2.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.2.2 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.1 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.0 - _January 9, 2019_
|
||||
|
||||
* Added LibAddressArray (#1383)
|
||||
|
@@ -6,10 +6,10 @@ Smart contracts that implement the 0x protocol. Addresses of the deployed contra
|
||||
|
||||
Contracts that make up and interact with version 2.0.0 of the protocol can be found in the [contracts](./contracts) directory. The contents of this directory are broken down into the following subdirectories:
|
||||
|
||||
* [protocol](./contracts/protocol)
|
||||
* This directory contains the contracts that make up version 2.0.0. A full specification can be found [here](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md).
|
||||
* [test](./contracts/test)
|
||||
* This directory contains mocks and other contracts that are used solely for testing contracts within the other directories.
|
||||
- [protocol](./contracts/protocol)
|
||||
- This directory contains the contracts that make up version 2.0.0. A full specification can be found [here](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md).
|
||||
- [test](./contracts/test)
|
||||
- This directory contains mocks and other contracts that are used solely for testing contracts within the other directories.
|
||||
|
||||
## Bug bounty
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-protocol",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,12 +44,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.20",
|
||||
"@0x/dev-utils": "^1.0.22",
|
||||
"@0x/sol-compiler": "^2.0.0",
|
||||
"@0x/sol-cov": "^2.1.17",
|
||||
"@0x/subproviders": "^2.1.9",
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/abi-gen": "^1.0.22",
|
||||
"@0x/dev-utils": "^1.0.24",
|
||||
"@0x/sol-compiler": "^2.0.2",
|
||||
"@0x/subproviders": "^2.1.11",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -69,22 +68,22 @@
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^3.0.11",
|
||||
"@0x/contracts-examples": "^1.0.3",
|
||||
"@0x/contracts-interfaces": "^1.0.3",
|
||||
"@0x/contracts-libs": "^1.0.3",
|
||||
"@0x/contracts-multisig": "^1.0.3",
|
||||
"@0x/contracts-test-utils": "^1.0.3",
|
||||
"@0x/contracts-tokens": "^1.0.3",
|
||||
"@0x/contracts-utils": "^1.0.3",
|
||||
"@0x/order-utils": "^3.1.0",
|
||||
"@0x/types": "^1.5.0",
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/web3-wrapper": "^3.2.2",
|
||||
"@0x/base-contract": "^3.0.13",
|
||||
"@0x/contracts-examples": "^1.0.5",
|
||||
"@0x/contracts-interfaces": "^1.0.5",
|
||||
"@0x/contracts-libs": "^1.0.5",
|
||||
"@0x/contracts-multisig": "^1.0.5",
|
||||
"@0x/contracts-test-utils": "^2.0.0",
|
||||
"@0x/contracts-tokens": "^1.0.5",
|
||||
"@0x/contracts-utils": "^1.0.5",
|
||||
"@0x/order-utils": "^3.1.2",
|
||||
"@0x/types": "^1.5.2",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"@0x/web3-wrapper": "^3.2.4",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -1043,7 +1043,7 @@ describe('Exchange core', () => {
|
||||
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = new BigNumber(0);
|
||||
const expectedOrderStatus = OrderStatus.FILLABLE;
|
||||
const expectedOrderStatus = OrderStatus.Fillable;
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
|
||||
@@ -1053,7 +1053,7 @@ describe('Exchange core', () => {
|
||||
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount;
|
||||
const expectedOrderStatus = OrderStatus.FULLY_FILLED;
|
||||
const expectedOrderStatus = OrderStatus.FullyFilled;
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
|
||||
@@ -1064,7 +1064,7 @@ describe('Exchange core', () => {
|
||||
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = takerAssetFillAmount;
|
||||
const expectedOrderStatus = OrderStatus.FILLABLE;
|
||||
const expectedOrderStatus = OrderStatus.Fillable;
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
|
||||
@@ -1074,7 +1074,7 @@ describe('Exchange core', () => {
|
||||
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = new BigNumber(0);
|
||||
const expectedOrderStatus = OrderStatus.CANCELLED;
|
||||
const expectedOrderStatus = OrderStatus.Cancelled;
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
|
||||
@@ -1086,7 +1086,7 @@ describe('Exchange core', () => {
|
||||
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = takerAssetFillAmount;
|
||||
const expectedOrderStatus = OrderStatus.CANCELLED;
|
||||
const expectedOrderStatus = OrderStatus.Cancelled;
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
|
||||
@@ -1098,7 +1098,7 @@ describe('Exchange core', () => {
|
||||
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = new BigNumber(0);
|
||||
const expectedOrderStatus = OrderStatus.EXPIRED;
|
||||
const expectedOrderStatus = OrderStatus.Expired;
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
|
||||
@@ -1112,7 +1112,7 @@ describe('Exchange core', () => {
|
||||
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = takerAssetFillAmount;
|
||||
const expectedOrderStatus = OrderStatus.EXPIRED;
|
||||
const expectedOrderStatus = OrderStatus.Expired;
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
|
||||
@@ -1126,7 +1126,7 @@ describe('Exchange core', () => {
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount;
|
||||
// FULLY_FILLED takes precedence over EXPIRED
|
||||
const expectedOrderStatus = OrderStatus.FULLY_FILLED;
|
||||
const expectedOrderStatus = OrderStatus.FullyFilled;
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
|
||||
@@ -1136,7 +1136,7 @@ describe('Exchange core', () => {
|
||||
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = new BigNumber(0);
|
||||
const expectedOrderStatus = OrderStatus.INVALID_MAKER_ASSET_AMOUNT;
|
||||
const expectedOrderStatus = OrderStatus.InvalidMakerAssetAmount;
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
|
||||
@@ -1146,7 +1146,7 @@ describe('Exchange core', () => {
|
||||
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = new BigNumber(0);
|
||||
const expectedOrderStatus = OrderStatus.INVALID_TAKER_ASSET_AMOUNT;
|
||||
const expectedOrderStatus = OrderStatus.InvalidTakerAssetAmount;
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
|
||||
|
@@ -1288,7 +1288,7 @@ describe('Exchange wrappers', () => {
|
||||
_.forEach(signedOrders, (signedOrder, index) => {
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = new BigNumber(0);
|
||||
const expectedOrderStatus = OrderStatus.FILLABLE;
|
||||
const expectedOrderStatus = OrderStatus.Fillable;
|
||||
const orderInfo = ordersInfo[index];
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
@@ -1303,7 +1303,7 @@ describe('Exchange wrappers', () => {
|
||||
_.forEach(signedOrders, (signedOrder, index) => {
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount.div(2);
|
||||
const expectedOrderStatus = OrderStatus.FILLABLE;
|
||||
const expectedOrderStatus = OrderStatus.Fillable;
|
||||
const orderInfo = ordersInfo[index];
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
@@ -1317,7 +1317,7 @@ describe('Exchange wrappers', () => {
|
||||
_.forEach(signedOrders, (signedOrder, index) => {
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount;
|
||||
const expectedOrderStatus = OrderStatus.FULLY_FILLED;
|
||||
const expectedOrderStatus = OrderStatus.FullyFilled;
|
||||
const orderInfo = ordersInfo[index];
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
@@ -1331,7 +1331,7 @@ describe('Exchange wrappers', () => {
|
||||
_.forEach(signedOrders, (signedOrder, index) => {
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = new BigNumber(0);
|
||||
const expectedOrderStatus = OrderStatus.CANCELLED;
|
||||
const expectedOrderStatus = OrderStatus.Cancelled;
|
||||
const orderInfo = ordersInfo[index];
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
@@ -1347,7 +1347,7 @@ describe('Exchange wrappers', () => {
|
||||
_.forEach(signedOrders, (signedOrder, index) => {
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount.div(2);
|
||||
const expectedOrderStatus = OrderStatus.CANCELLED;
|
||||
const expectedOrderStatus = OrderStatus.Cancelled;
|
||||
const orderInfo = ordersInfo[index];
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
@@ -1363,7 +1363,7 @@ describe('Exchange wrappers', () => {
|
||||
_.forEach(signedOrders, (signedOrder, index) => {
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = new BigNumber(0);
|
||||
const expectedOrderStatus = OrderStatus.EXPIRED;
|
||||
const expectedOrderStatus = OrderStatus.Expired;
|
||||
const orderInfo = ordersInfo[index];
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
@@ -1381,7 +1381,7 @@ describe('Exchange wrappers', () => {
|
||||
_.forEach(signedOrders, (signedOrder, index) => {
|
||||
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount.div(2);
|
||||
const expectedOrderStatus = OrderStatus.EXPIRED;
|
||||
const expectedOrderStatus = OrderStatus.Expired;
|
||||
const orderInfo = ordersInfo[index];
|
||||
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
|
||||
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
|
||||
@@ -1408,7 +1408,7 @@ describe('Exchange wrappers', () => {
|
||||
|
||||
const expectedUnfilledOrderHash = orderHashUtils.getOrderHashHex(unfilledOrder);
|
||||
const expectedUnfilledTakerAssetFilledAmount = new BigNumber(0);
|
||||
const expectedUnfilledOrderStatus = OrderStatus.FILLABLE;
|
||||
const expectedUnfilledOrderStatus = OrderStatus.Fillable;
|
||||
const unfilledOrderInfo = ordersInfo[0];
|
||||
expect(unfilledOrderInfo.orderHash).to.be.equal(expectedUnfilledOrderHash);
|
||||
expect(unfilledOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(
|
||||
@@ -1418,7 +1418,7 @@ describe('Exchange wrappers', () => {
|
||||
|
||||
const expectedPartialOrderHash = orderHashUtils.getOrderHashHex(partiallyFilledOrder);
|
||||
const expectedPartialTakerAssetFilledAmount = partiallyFilledOrder.takerAssetAmount.div(2);
|
||||
const expectedPartialOrderStatus = OrderStatus.FILLABLE;
|
||||
const expectedPartialOrderStatus = OrderStatus.Fillable;
|
||||
const partialOrderInfo = ordersInfo[1];
|
||||
expect(partialOrderInfo.orderHash).to.be.equal(expectedPartialOrderHash);
|
||||
expect(partialOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(
|
||||
@@ -1428,7 +1428,7 @@ describe('Exchange wrappers', () => {
|
||||
|
||||
const expectedFilledOrderHash = orderHashUtils.getOrderHashHex(fullyFilledOrder);
|
||||
const expectedFilledTakerAssetFilledAmount = fullyFilledOrder.takerAssetAmount;
|
||||
const expectedFilledOrderStatus = OrderStatus.FULLY_FILLED;
|
||||
const expectedFilledOrderStatus = OrderStatus.FullyFilled;
|
||||
const filledOrderInfo = ordersInfo[2];
|
||||
expect(filledOrderInfo.orderHash).to.be.equal(expectedFilledOrderHash);
|
||||
expect(filledOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(
|
||||
@@ -1438,7 +1438,7 @@ describe('Exchange wrappers', () => {
|
||||
|
||||
const expectedCancelledOrderHash = orderHashUtils.getOrderHashHex(cancelledOrder);
|
||||
const expectedCancelledTakerAssetFilledAmount = new BigNumber(0);
|
||||
const expectedCancelledOrderStatus = OrderStatus.CANCELLED;
|
||||
const expectedCancelledOrderStatus = OrderStatus.Cancelled;
|
||||
const cancelledOrderInfo = ordersInfo[3];
|
||||
expect(cancelledOrderInfo.orderHash).to.be.equal(expectedCancelledOrderHash);
|
||||
expect(cancelledOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(
|
||||
@@ -1448,7 +1448,7 @@ describe('Exchange wrappers', () => {
|
||||
|
||||
const expectedExpiredOrderHash = orderHashUtils.getOrderHashHex(expiredOrder);
|
||||
const expectedExpiredTakerAssetFilledAmount = new BigNumber(0);
|
||||
const expectedExpiredOrderStatus = OrderStatus.EXPIRED;
|
||||
const expectedExpiredOrderStatus = OrderStatus.Expired;
|
||||
const expiredOrderInfo = ordersInfo[4];
|
||||
expect(expiredOrderInfo.orderHash).to.be.equal(expectedExpiredOrderHash);
|
||||
expect(expiredOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(
|
||||
|
@@ -8,13 +8,16 @@ import {
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { artifacts as tokensArtifacts } from '@0x/contracts-tokens';
|
||||
import { SignedOrder } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
|
||||
import { MethodAbi, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { ExchangeContract } from '../../generated-wrappers/exchange';
|
||||
import { artifacts } from '../../src/artifacts';
|
||||
|
||||
import { AbiDecodedFillOrderData } from './types';
|
||||
|
||||
export class ExchangeWrapper {
|
||||
private readonly _exchange: ExchangeContract;
|
||||
private readonly _web3Wrapper: Web3Wrapper;
|
||||
@@ -275,6 +278,14 @@ export class ExchangeWrapper {
|
||||
);
|
||||
return data;
|
||||
}
|
||||
public abiDecodeFillOrder(data: string): AbiDecodedFillOrderData {
|
||||
// Lookup fillOrder ABI in exchange abi
|
||||
const fillOrderAbi = _.find(this._exchange.abi, { name: 'fillOrder' }) as MethodAbi;
|
||||
// Decode input data
|
||||
const abiEncoder = new AbiEncoder.Method(fillOrderAbi);
|
||||
const decodedData = abiEncoder.decode(data) as AbiDecodedFillOrderData;
|
||||
return decodedData;
|
||||
}
|
||||
public getExchangeAddress(): string {
|
||||
return this._exchange.address;
|
||||
}
|
||||
|
@@ -613,13 +613,13 @@ export class FillOrderCombinatorialUtils {
|
||||
takerAssetFillAmount: BigNumber,
|
||||
): Promise<void> {
|
||||
const params = orderUtils.createFill(signedOrder, takerAssetFillAmount);
|
||||
const expectedAbiEncodedData = this.exchangeWrapper.abiEncodeFillOrder(signedOrder, { takerAssetFillAmount });
|
||||
const libsAbiEncodedData = await this.testLibsContract.publicAbiEncodeFillOrder.callAsync(
|
||||
const abiDataEncodedByContract = await this.testLibsContract.publicAbiEncodeFillOrder.callAsync(
|
||||
params.order,
|
||||
params.takerAssetFillAmount,
|
||||
params.signature,
|
||||
);
|
||||
expect(libsAbiEncodedData).to.be.equal(expectedAbiEncodedData, 'ABIEncodedFillOrderData');
|
||||
const paramsDecodedByClient = this.exchangeWrapper.abiDecodeFillOrder(abiDataEncodedByContract);
|
||||
expect(paramsDecodedByClient).to.be.deep.equal(params, 'ABIEncodedFillOrderData');
|
||||
}
|
||||
private async _getTakerAssetFillAmountAsync(
|
||||
signedOrder: SignedOrder,
|
||||
|
@@ -268,15 +268,15 @@ export class MatchOrderTester {
|
||||
const maxAmountBoughtByLeftMaker = signedOrderLeft.takerAssetAmount.minus(initialLeftOrderFilledAmount);
|
||||
const leftOrderInfo: OrderInfo = await this._exchangeWrapper.getOrderInfoAsync(signedOrderLeft);
|
||||
const leftExpectedStatus = expectedTransferAmounts.amountBoughtByLeftMaker.equals(maxAmountBoughtByLeftMaker)
|
||||
? OrderStatus.FULLY_FILLED
|
||||
: OrderStatus.FILLABLE;
|
||||
? OrderStatus.FullyFilled
|
||||
: OrderStatus.Fillable;
|
||||
expect(leftOrderInfo.orderStatus, 'Checking exchange status for left order').to.be.equal(leftExpectedStatus);
|
||||
// Assert right order status
|
||||
const maxAmountBoughtByRightMaker = signedOrderRight.takerAssetAmount.minus(initialRightOrderFilledAmount);
|
||||
const rightOrderInfo: OrderInfo = await this._exchangeWrapper.getOrderInfoAsync(signedOrderRight);
|
||||
const rightExpectedStatus = expectedTransferAmounts.amountBoughtByRightMaker.equals(maxAmountBoughtByRightMaker)
|
||||
? OrderStatus.FULLY_FILLED
|
||||
: OrderStatus.FILLABLE;
|
||||
? OrderStatus.FullyFilled
|
||||
: OrderStatus.Fillable;
|
||||
expect(rightOrderInfo.orderStatus, 'Checking exchange status for right order').to.be.equal(rightExpectedStatus);
|
||||
}
|
||||
/// @dev Asserts account balances after matching orders.
|
||||
|
8
contracts/protocol/test/utils/types.ts
Normal file
8
contracts/protocol/test/utils/types.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { SignedOrder } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
|
||||
export interface AbiDecodedFillOrderData {
|
||||
order: SignedOrder;
|
||||
takerAssetFillAmount: BigNumber;
|
||||
signature: string;
|
||||
}
|
@@ -1,4 +1,23 @@
|
||||
[
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Renamed OrderStatus enum members to PascalCase to conform with tslint enum-naming rule",
|
||||
"pr": 1474
|
||||
}
|
||||
],
|
||||
"timestamp": 1547561734
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "1.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547040760,
|
||||
"version": "1.0.3",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.0 - _January 15, 2019_
|
||||
|
||||
* Renamed OrderStatus enum members to PascalCase to conform with tslint enum-naming rule (#1474)
|
||||
|
||||
## v1.0.4 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.3 - _January 9, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-test-utils",
|
||||
"version": "1.0.3",
|
||||
"version": "2.0.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -40,17 +40,19 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/abi-gen": "^1.0.20",
|
||||
"@0x/dev-utils": "^1.0.22",
|
||||
"@0x/order-utils": "^3.1.0",
|
||||
"@0x/sol-compiler": "^2.0.0",
|
||||
"@0x/sol-cov": "^2.1.17",
|
||||
"@0x/subproviders": "^2.1.9",
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/types": "^1.5.0",
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/web3-wrapper": "^3.2.2",
|
||||
"@0x/abi-gen": "^1.0.22",
|
||||
"@0x/dev-utils": "^1.0.24",
|
||||
"@0x/order-utils": "^3.1.2",
|
||||
"@0x/sol-compiler": "^2.0.2",
|
||||
"@0x/sol-coverage": "^1.0.2",
|
||||
"@0x/sol-profiler": "^1.0.2",
|
||||
"@0x/sol-trace": "^1.0.2",
|
||||
"@0x/subproviders": "^2.1.11",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@0x/types": "^1.5.2",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"@0x/web3-wrapper": "^3.2.4",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/ethereumjs-abi": "^0.6.0",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
@@ -61,7 +63,7 @@
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^2.0.1",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"ethereumjs-abi": "0.6.5",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"ethers": "~4.0.4",
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { devConstants } from '@0x/dev-utils';
|
||||
import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
|
||||
import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-coverage';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
let coverageSubprovider: CoverageSubprovider;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { devConstants } from '@0x/dev-utils';
|
||||
import { ProfilerSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
|
||||
import { ProfilerSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-profiler';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
let profilerSubprovider: ProfilerSubprovider;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { devConstants } from '@0x/dev-utils';
|
||||
import { RevertTraceSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-cov';
|
||||
import { RevertTraceSubprovider, SolCompilerArtifactAdapter } from '@0x/sol-trace';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
let revertTraceSubprovider: RevertTraceSubprovider;
|
||||
|
@@ -70,13 +70,13 @@ export interface Token {
|
||||
}
|
||||
|
||||
export enum OrderStatus {
|
||||
INVALID,
|
||||
INVALID_MAKER_ASSET_AMOUNT,
|
||||
INVALID_TAKER_ASSET_AMOUNT,
|
||||
FILLABLE,
|
||||
EXPIRED,
|
||||
FULLY_FILLED,
|
||||
CANCELLED,
|
||||
Invalid,
|
||||
InvalidMakerAssetAmount,
|
||||
InvalidTakerAssetAmount,
|
||||
Fillable,
|
||||
Expired,
|
||||
FullyFilled,
|
||||
Cancelled,
|
||||
}
|
||||
|
||||
export enum ContractName {
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "1.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "1.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547040760,
|
||||
"version": "1.0.3",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.5 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.4 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.3 - _January 9, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -6,10 +6,10 @@ Token smart contracts that are used in the 0x protocol. Addresses of the deploye
|
||||
|
||||
Token contracts that make up and interact with version 2.0.0 of the protocol can be found in the [contracts](./contracts) directory. The contents of this directory are broken down into the following subdirectories:
|
||||
|
||||
* [tokens](./contracts/tokens)
|
||||
* This directory contains implementations of different tokens and token standards, including [wETH](https://weth.io/), ZRX, [ERC20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md), and [ERC721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md).
|
||||
* [test](./contracts/test)
|
||||
* This directory contains mocks and other contracts that are used solely for testing contracts within the other directories.
|
||||
- [tokens](./contracts/tokens)
|
||||
- This directory contains implementations of different tokens and token standards, including [wETH](https://weth.io/), ZRX, [ERC20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md), and [ERC721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md).
|
||||
- [test](./contracts/test)
|
||||
- This directory contains mocks and other contracts that are used solely for testing contracts within the other directories.
|
||||
|
||||
## Bug bounty
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-tokens",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,13 +44,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.20",
|
||||
"@0x/contracts-test-utils": "^1.0.3",
|
||||
"@0x/dev-utils": "^1.0.22",
|
||||
"@0x/sol-compiler": "^2.0.0",
|
||||
"@0x/sol-cov": "^2.1.17",
|
||||
"@0x/subproviders": "^2.1.9",
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/abi-gen": "^1.0.22",
|
||||
"@0x/contracts-test-utils": "^2.0.0",
|
||||
"@0x/dev-utils": "^1.0.24",
|
||||
"@0x/sol-compiler": "^2.0.2",
|
||||
"@0x/subproviders": "^2.1.11",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -70,19 +69,19 @@
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^3.0.11",
|
||||
"@0x/contracts-interfaces": "^1.0.3",
|
||||
"@0x/contracts-libs": "^1.0.3",
|
||||
"@0x/contracts-multisig": "^1.0.3",
|
||||
"@0x/contracts-utils": "^1.0.3",
|
||||
"@0x/order-utils": "^3.1.0",
|
||||
"@0x/types": "^1.5.0",
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/web3-wrapper": "^3.2.2",
|
||||
"@0x/base-contract": "^3.0.13",
|
||||
"@0x/contracts-interfaces": "^1.0.5",
|
||||
"@0x/contracts-libs": "^1.0.5",
|
||||
"@0x/contracts-multisig": "^1.0.5",
|
||||
"@0x/contracts-utils": "^1.0.5",
|
||||
"@0x/order-utils": "^3.1.2",
|
||||
"@0x/types": "^1.5.2",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"@0x/web3-wrapper": "^3.2.4",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "1.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "1.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547040760,
|
||||
"version": "1.0.3",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.5 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.4 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.3 - _January 9, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -6,10 +6,10 @@ Smart contracts utils used in the 0x protocol.
|
||||
|
||||
Contracts can be found in the [contracts](./contracts) directory. The contents of this directory are broken down into the following subdirectories:
|
||||
|
||||
* [utils](./contracts/utils)
|
||||
* This directory contains libraries and utils.
|
||||
* [test](./contracts/test)
|
||||
* This directory contains mocks and other contracts that are used solely for testing contracts within the other directories.
|
||||
- [utils](./contracts/utils)
|
||||
- This directory contains libraries and utils.
|
||||
- [test](./contracts/test)
|
||||
- This directory contains mocks and other contracts that are used solely for testing contracts within the other directories.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-utils",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,13 +44,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.20",
|
||||
"@0x/contracts-test-utils": "^1.0.3",
|
||||
"@0x/dev-utils": "^1.0.22",
|
||||
"@0x/sol-compiler": "^2.0.0",
|
||||
"@0x/sol-cov": "^2.1.17",
|
||||
"@0x/subproviders": "^2.1.9",
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/abi-gen": "^1.0.22",
|
||||
"@0x/contracts-test-utils": "^2.0.0",
|
||||
"@0x/dev-utils": "^1.0.24",
|
||||
"@0x/sol-compiler": "^2.0.2",
|
||||
"@0x/subproviders": "^2.1.11",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -71,14 +70,14 @@
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^3.0.11",
|
||||
"@0x/contracts-multisig": "^1.0.3",
|
||||
"@0x/order-utils": "^3.1.0",
|
||||
"@0x/types": "^1.5.0",
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/web3-wrapper": "^3.2.2",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"@0x/base-contract": "^3.0.13",
|
||||
"@0x/contracts-multisig": "^1.0.5",
|
||||
"@0x/order-utils": "^3.1.2",
|
||||
"@0x/types": "^1.5.2",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"@0x/web3-wrapper": "^3.2.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -41,7 +41,7 @@
|
||||
},
|
||||
"config": {
|
||||
"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-cov ethereum-types asset-buyer migrations"
|
||||
"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"
|
||||
},
|
||||
"bundlewatch": {
|
||||
"files": [
|
||||
@@ -62,6 +62,9 @@
|
||||
"repoBranchBase": "development"
|
||||
}
|
||||
},
|
||||
"resolutions": {
|
||||
"graceful-fs": "4.1.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x-lerna-fork/lerna": "3.0.0-beta.26",
|
||||
"@0xproject/npm-cli-login": "^0.0.11",
|
||||
@@ -72,7 +75,7 @@
|
||||
"lcov-result-merger": "^3.0.0",
|
||||
"lerna": "^3.0.0-beta.25",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"prettier": "^1.11.1",
|
||||
"prettier": "^1.15.3",
|
||||
"source-map-support": "^0.5.6",
|
||||
"typescript": "3.0.1",
|
||||
"wsrun": "^2.2.0"
|
||||
|
@@ -1,10 +1,27 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "3.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "3.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Export `MultiAssetData`, `MultiAssetDataWithRecursiveDecoding`, `ObjectMap`, and `SingleAssetData` from types. No longer export `AssetData`.",
|
||||
"note": "Export `MultiAssetData`, `MultiAssetDataWithRecursiveDecoding`, `ObjectMap`, and `SingleAssetData` from types. No longer export `AssetData`.",
|
||||
"pr": 1363
|
||||
}
|
||||
],
|
||||
@@ -90,18 +107,15 @@
|
||||
"pr": 1102
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Added `MetamaskSubprovider` to handle inconsistencies in Metamask's signing JSON RPC endpoints.",
|
||||
"note": "Added `MetamaskSubprovider` to handle inconsistencies in Metamask's signing JSON RPC endpoints.",
|
||||
"pr": 1102
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Removed `SignerType` (including `SignerType.Metamask`). Please use the `MetamaskSubprovider` to wrap `web3.currentProvider`.",
|
||||
"note": "Removed `SignerType` (including `SignerType.Metamask`). Please use the `MetamaskSubprovider` to wrap `web3.currentProvider`.",
|
||||
"pr": 1102
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers",
|
||||
"note": "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers",
|
||||
"pr": 1105
|
||||
},
|
||||
{
|
||||
@@ -200,8 +214,7 @@
|
||||
"version": "1.0.1-rc.5",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Fix `main` and `types` package.json entries so that they point to the new location of index.d.ts and index.js"
|
||||
"note": "Fix `main` and `types` package.json entries so that they point to the new location of index.d.ts and index.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -209,8 +222,7 @@
|
||||
"version": "1.0.1-rc.4",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Re-organize the exported interface of 0x.js. Remove the `ZeroEx` class, and instead export the same exports as `0x.js`'s sub-packages: `@0xproject/contract-wrappers`, `@0xproject/order-utils` and `@0xproject/order-watcher`",
|
||||
"note": "Re-organize the exported interface of 0x.js. Remove the `ZeroEx` class, and instead export the same exports as `0x.js`'s sub-packages: `@0xproject/contract-wrappers`, `@0xproject/order-utils` and `@0xproject/order-watcher`",
|
||||
"pr": 963
|
||||
}
|
||||
],
|
||||
@@ -282,18 +294,15 @@
|
||||
"pr": 863
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Refactored `ZeroEx.isValidSignature` to `zeroEx.isValidSignatureAsync`. It is now async so that it can verify contract-dependent signature types",
|
||||
"note": "Refactored `ZeroEx.isValidSignature` to `zeroEx.isValidSignatureAsync`. It is now async so that it can verify contract-dependent signature types",
|
||||
"pr": 863
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Refactored `signOrderHashAsync` to `ecSignOrderHashAsync`. There are now many non-ECSignature ways to sign orders too.",
|
||||
"note": "Refactored `signOrderHashAsync` to `ecSignOrderHashAsync`. There are now many non-ECSignature ways to sign orders too.",
|
||||
"pr": 863
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Removed `createOrderWatcherAsync` method. Will be added back once OrderWatcher is refactored for V2",
|
||||
"note": "Removed `createOrderWatcherAsync` method. Will be added back once OrderWatcher is refactored for V2",
|
||||
"pr": 863
|
||||
},
|
||||
{
|
||||
@@ -368,8 +377,7 @@
|
||||
"pr": 579
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage",
|
||||
"note": "Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage",
|
||||
"pr": 579
|
||||
}
|
||||
],
|
||||
@@ -454,8 +462,7 @@
|
||||
"pr": 501
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Add `zeroEx.exchange.getOrderStateAsync` to allow obtaining current OrderState for a signedOrder",
|
||||
"note": "Add `zeroEx.exchange.getOrderStateAsync` to allow obtaining current OrderState for a signedOrder",
|
||||
"pr": 510
|
||||
}
|
||||
],
|
||||
@@ -465,8 +472,7 @@
|
||||
"version": "0.35.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Removed `ZeroExError.TransactionMiningTimeout` and moved it to '@0xproject/web3-wrapper' `Web3WrapperErrors.TransactionMiningTimeout`",
|
||||
"note": "Removed `ZeroExError.TransactionMiningTimeout` and moved it to '@0xproject/web3-wrapper' `Web3WrapperErrors.TransactionMiningTimeout`",
|
||||
"pr": 485
|
||||
}
|
||||
],
|
||||
@@ -476,8 +482,7 @@
|
||||
"version": "0.34.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Fix the bug causing `zeroEx.exchange.fillOrdersUpToAsync` validation to fail if there were some extra orders passed",
|
||||
"note": "Fix the bug causing `zeroEx.exchange.fillOrdersUpToAsync` validation to fail if there were some extra orders passed",
|
||||
"pr": 470
|
||||
},
|
||||
{
|
||||
@@ -489,8 +494,7 @@
|
||||
"pr": 488
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Added `stateLayer` setting to `OrderStateWatcherConfig` so OrderStateWatcher can be set to monitor different blockchain state layers",
|
||||
"note": "Added `stateLayer` setting to `OrderStateWatcherConfig` so OrderStateWatcher can be set to monitor different blockchain state layers",
|
||||
"pr": 488
|
||||
}
|
||||
],
|
||||
@@ -577,8 +581,7 @@
|
||||
"pr": 350
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Fixed the bug causing order watcher to throw if there is an event with the same signature but different indexed fields",
|
||||
"note": "Fixed the bug causing order watcher to throw if there is an event with the same signature but different indexed fields",
|
||||
"pr": 366
|
||||
}
|
||||
],
|
||||
@@ -598,8 +601,7 @@
|
||||
"version": "0.31.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Add the `shouldAddPersonalMessagePrefix` parameter to `signOrderHashAsync` so that the caller can decide on whether to add the personalMessage prefix before relaying the request to the signer. Parity Signer, Ledger and TestRPC add the prefix themselves, Metamask expects it to have already been added.",
|
||||
"note": "Add the `shouldAddPersonalMessagePrefix` parameter to `signOrderHashAsync` so that the caller can decide on whether to add the personalMessage prefix before relaying the request to the signer. Parity Signer, Ledger and TestRPC add the prefix themselves, Metamask expects it to have already been added.",
|
||||
"pr": 349
|
||||
}
|
||||
],
|
||||
@@ -644,8 +646,7 @@
|
||||
"pr": 312
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Fix a bug in fillOrdersUpTo validation making it impossible to fill up to if user doesn't have enough balance to fully fill all the orders",
|
||||
"note": "Fix a bug in fillOrdersUpTo validation making it impossible to fill up to if user doesn't have enough balance to fully fill all the orders",
|
||||
"pr": 321
|
||||
}
|
||||
],
|
||||
@@ -679,13 +680,11 @@
|
||||
"version": "0.28.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Add `etherTokenAddress` arg to `depositAsync` and `withdrawAsync` methods on `zeroEx.etherToken`",
|
||||
"note": "Add `etherTokenAddress` arg to `depositAsync` and `withdrawAsync` methods on `zeroEx.etherToken`",
|
||||
"pr": 267
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Removed accidentally included `unsubscribeAll` method from `zeroEx.proxy`, `zeroEx.etherToken` and `zeroEx.tokenRegistry`",
|
||||
"note": "Removed accidentally included `unsubscribeAll` method from `zeroEx.proxy`, `zeroEx.etherToken` and `zeroEx.tokenRegistry`",
|
||||
"pr": 267
|
||||
},
|
||||
{
|
||||
@@ -697,8 +696,7 @@
|
||||
"pr": 272
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Add `zeroEx.etherToken.subscribe`, `zeroEx.etherToken.unsubscribe`, `zeroEx.etherToken.unsubscribeAll`",
|
||||
"note": "Add `zeroEx.etherToken.subscribe`, `zeroEx.etherToken.unsubscribe`, `zeroEx.etherToken.unsubscribeAll`",
|
||||
"pr": 277
|
||||
},
|
||||
{
|
||||
@@ -706,8 +704,7 @@
|
||||
"pr": 277
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Add new public types `BlockParamLiteral`, `EtherTokenEvents`, `EtherTokenContractEventArgs`, `DepositContractEventArgs`, `WithdrawalContractEventArgs`",
|
||||
"note": "Add new public types `BlockParamLiteral`, `EtherTokenEvents`, `EtherTokenContractEventArgs`, `DepositContractEventArgs`, `WithdrawalContractEventArgs`",
|
||||
"pr": 277
|
||||
},
|
||||
{
|
||||
@@ -742,8 +739,7 @@
|
||||
"pr": 233
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Make all `getContractAddress` functions, `zeroEx.exchange.subscribe`, `zeroEx.exchange.getZRXTokenAddress` sync",
|
||||
"note": "Make all `getContractAddress` functions, `zeroEx.exchange.subscribe`, `zeroEx.exchange.getZRXTokenAddress` sync",
|
||||
"pr": 233
|
||||
},
|
||||
{
|
||||
@@ -751,8 +747,7 @@
|
||||
"pr": 233
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Make `DecodedLogEvent<A>` contain `LogWithDecodedArgs<A>` under log key instead of merging it in like web3 does",
|
||||
"note": "Make `DecodedLogEvent<A>` contain `LogWithDecodedArgs<A>` under log key instead of merging it in like web3 does",
|
||||
"pr": 234
|
||||
},
|
||||
{
|
||||
@@ -768,8 +763,7 @@
|
||||
"pr": 235
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Modify order validation methods to validate against the `latest` block, not against the `pending` block",
|
||||
"note": "Modify order validation methods to validate against the `latest` block, not against the `pending` block",
|
||||
"pr": 236
|
||||
}
|
||||
],
|
||||
@@ -779,8 +773,7 @@
|
||||
"version": "0.26.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Add post-formatter for logs converting `blockNumber`, `logIndex`, `transactionIndex` from hexes to numbers",
|
||||
"note": "Add post-formatter for logs converting `blockNumber`, `logIndex`, `transactionIndex` from hexes to numbers",
|
||||
"pr": 231
|
||||
},
|
||||
{
|
||||
@@ -788,8 +781,7 @@
|
||||
"pr": 222
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"In OrderWatcher subscribe to ZRX Token Transfer and Approval events when maker token is different",
|
||||
"note": "In OrderWatcher subscribe to ZRX Token Transfer and Approval events when maker token is different",
|
||||
"pr": 225
|
||||
}
|
||||
],
|
||||
@@ -807,8 +799,7 @@
|
||||
"pr": 205
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Normalized the transactionReceipt status to be `null|0|1`, 1 meaning transaction execution successful, 0 unsuccessful and `null` if it is a pre-byzantinium transaction.",
|
||||
"note": "Normalized the transactionReceipt status to be `null|0|1`, 1 meaning transaction execution successful, 0 unsuccessful and `null` if it is a pre-byzantinium transaction.",
|
||||
"pr": 200
|
||||
}
|
||||
],
|
||||
@@ -879,8 +870,7 @@
|
||||
"version": "0.22.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Started using `OrderFillRequest` interface instead of `OrderFillOrKillRequest` interface for `zeroEx.exchange.batchFillOrKill`",
|
||||
"note": "Started using `OrderFillRequest` interface instead of `OrderFillOrKillRequest` interface for `zeroEx.exchange.batchFillOrKill`",
|
||||
"pr": 187
|
||||
},
|
||||
{
|
||||
@@ -894,8 +884,7 @@
|
||||
"version": "0.21.4",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Made 0x.js more type-safe by making `getLogsAsync` and `subscribe/subscribeAsync` generics parametrized with arg type",
|
||||
"note": "Made 0x.js more type-safe by making `getLogsAsync` and `subscribe/subscribeAsync` generics parametrized with arg type",
|
||||
"pr": 194
|
||||
}
|
||||
],
|
||||
@@ -942,8 +931,7 @@
|
||||
"note": "Subscriptions no longer return historical logs. If you want them - use `getLogsAsync`"
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Subscriptions now use [ethereumjs-blockstream](https://github.com/ethereumjs/ethereumjs-blockstream) under the hood"
|
||||
"note": "Subscriptions now use [ethereumjs-blockstream](https://github.com/ethereumjs/ethereumjs-blockstream) under the hood"
|
||||
},
|
||||
{
|
||||
"note": "Subscriptions correctly handle block re-orgs (forks)"
|
||||
@@ -952,8 +940,7 @@
|
||||
"note": "Subscriptions correctly backfill logs (connection problems)"
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"They no longer setup filters on the underlying nodes, so you can use them with infura without a filter Subprovider"
|
||||
"note": "They no longer setup filters on the underlying nodes, so you can use them with infura without a filter Subprovider"
|
||||
},
|
||||
{
|
||||
"note": "Removed `ContractEventEmitter` and added `LogEvent`"
|
||||
@@ -1060,8 +1047,7 @@
|
||||
"version": "0.15.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Added the ability to specify a historical `blockNumber` at which to query the blockchain's state when calling a token or exchange method",
|
||||
"note": "Added the ability to specify a historical `blockNumber` at which to query the blockchain's state when calling a token or exchange method",
|
||||
"pr": 161
|
||||
}
|
||||
],
|
||||
@@ -1109,8 +1095,7 @@
|
||||
"version": "0.13.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Made all the functions submitting transactions to the network to immediately return transaction hash",
|
||||
"note": "Made all the functions submitting transactions to the network to immediately return transaction hash",
|
||||
"pr": 151
|
||||
},
|
||||
{
|
||||
@@ -1118,8 +1103,7 @@
|
||||
"pr": 151
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Added `TransactionReceiptWithDecodedLogs`, `LogWithDecodedArgs`, `DecodedLogArgs` to public types",
|
||||
"note": "Added `TransactionReceiptWithDecodedLogs`, `LogWithDecodedArgs`, `DecodedLogArgs` to public types",
|
||||
"pr": 151
|
||||
},
|
||||
{
|
||||
@@ -1292,8 +1276,7 @@
|
||||
"pr": 104
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Fixed an issue with incorrect balance/allowance validation when ZRX is one of the tokens traded",
|
||||
"note": "Fixed an issue with incorrect balance/allowance validation when ZRX is one of the tokens traded",
|
||||
"pr": 109
|
||||
}
|
||||
],
|
||||
@@ -1303,13 +1286,11 @@
|
||||
"version": "0.8.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Added the ability to call methods on different authorized versions of the Exchange smart contract",
|
||||
"note": "Added the ability to call methods on different authorized versions of the Exchange smart contract",
|
||||
"pr": 82
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Updated contract artifacts to reflect latest changes to the smart contracts (0xproject/contracts#59)"
|
||||
"note": "Updated contract artifacts to reflect latest changes to the smart contracts (0xproject/contracts#59)"
|
||||
},
|
||||
{
|
||||
"note": "Added `zeroEx.proxy.isAuthorizedAsync` and `zeroEx.proxy.getAuthorizedAddressesAsync`",
|
||||
@@ -1345,8 +1326,7 @@
|
||||
"version": "0.7.1",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Added the ability to convert Ether to wrapped Ether tokens and back via `zeroEx.etherToken.depostAsync` and `zeroEx.etherToken.withdrawAsync`",
|
||||
"note": "Added the ability to convert Ether to wrapped Ether tokens and back via `zeroEx.etherToken.depostAsync` and `zeroEx.etherToken.withdrawAsync`",
|
||||
"pr": 81
|
||||
}
|
||||
],
|
||||
@@ -1368,8 +1348,7 @@
|
||||
"pr": 72
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Renamed type `LogCancelArgs` to `LogCancelContractEventArgs` and `LogFillArgs` to `LogFillContractEventArgs`"
|
||||
"note": "Renamed type `LogCancelArgs` to `LogCancelContractEventArgs` and `LogFillArgs` to `LogFillContractEventArgs`"
|
||||
}
|
||||
],
|
||||
"timestamp": 1498057200
|
||||
@@ -1411,8 +1390,7 @@
|
||||
"version": "0.5.2",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Fixed the bug in `postpublish` script that caused that only unminified UMD bundle was uploaded to release page"
|
||||
"note": "Fixed the bug in `postpublish` script that caused that only unminified UMD bundle was uploaded to release page"
|
||||
}
|
||||
],
|
||||
"timestamp": 1497452400
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.2 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.1 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.0 - _January 9, 2019_
|
||||
|
||||
* Export `MultiAssetData`, `MultiAssetDataWithRecursiveDecoding`, `ObjectMap`, and `SingleAssetData` from types. No longer export `AssetData`. (#1363)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "0x.js",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -42,11 +42,11 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen-wrappers": "^2.1.0",
|
||||
"@0x/contract-addresses": "^2.1.0",
|
||||
"@0x/dev-utils": "^1.0.22",
|
||||
"@0x/migrations": "^2.3.0",
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/abi-gen-wrappers": "^2.2.0",
|
||||
"@0x/contract-addresses": "^2.2.0",
|
||||
"@0x/dev-utils": "^1.0.24",
|
||||
"@0x/migrations": "^2.4.0",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
"@types/node": "*",
|
||||
@@ -72,18 +72,18 @@
|
||||
"webpack": "^4.20.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^1.0.21",
|
||||
"@0x/base-contract": "^3.0.11",
|
||||
"@0x/contract-wrappers": "^4.2.0",
|
||||
"@0x/order-utils": "^3.1.0",
|
||||
"@0x/order-watcher": "^2.4.0",
|
||||
"@0x/subproviders": "^2.1.9",
|
||||
"@0x/types": "^1.5.0",
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/web3-wrapper": "^3.2.2",
|
||||
"@0x/assert": "^1.0.23",
|
||||
"@0x/base-contract": "^3.0.13",
|
||||
"@0x/contract-wrappers": "^5.0.0",
|
||||
"@0x/order-utils": "^3.1.2",
|
||||
"@0x/order-watcher": "^2.4.2",
|
||||
"@0x/subproviders": "^2.1.11",
|
||||
"@0x/types": "^1.5.2",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"@0x/web3-wrapper": "^3.2.4",
|
||||
"@types/web3-provider-engine": "^14.0.0",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.5",
|
||||
"web3-provider-engine": "14.0.6"
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "1.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1543401373,
|
||||
"version": "1.0.1",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.2 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.1 - _November 28, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -2,9 +2,9 @@ These templates are used with [abi-gen](https://github.com/0xProject/0x-monorepo
|
||||
|
||||
To successfully compile the generated TypeScript contract wrappers, you must:
|
||||
|
||||
* Install the packages on which the main contract template directly depends: `yarn add @0x/base-contract @0x/sol-compiler @0x/utils @0x/web3-wrapper ethereum-types ethers lodash`
|
||||
* Install the packages on which the main contract template *in*directly depends: `yarn add @types/lodash`
|
||||
* Ensure that your TypeScript configuration includes the following:
|
||||
- Install the packages on which the main contract template directly depends: `yarn add @0x/base-contract @0x/sol-compiler @0x/utils @0x/web3-wrapper ethereum-types ethers lodash`
|
||||
- Install the packages on which the main contract template *in*directly depends: `yarn add @types/lodash`
|
||||
- Ensure that your TypeScript configuration includes the following:
|
||||
|
||||
```
|
||||
"compilerOptions": {
|
||||
|
@@ -85,7 +85,7 @@ export class {{contractName}}Contract extends BaseContract {
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('{{contractName}}', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-templates",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
|
@@ -4,12 +4,7 @@ async callAsync(
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<{{> return_type outputs=outputs}}> {
|
||||
const self = this as any as {{contractName}}Contract;
|
||||
const functionSignature = '{{this.functionSignature}}';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [{{> params inputs=inputs}}]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.{{this.name}};
|
||||
const encodedData = ethersFunction.encode([{{> params inputs=inputs}}]);
|
||||
const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -20,9 +15,9 @@ async callAsync(
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray{{#singleReturnValue}}[0]{{/singleReturnValue}};
|
||||
const abiEncoder = self._lookupAbiEncoder('{{this.functionSignature}}');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<{{> return_type outputs=outputs}}>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
|
@@ -9,10 +9,7 @@ public {{this.tsName}} = {
|
||||
{{/this.payable}}
|
||||
): Promise<string> {
|
||||
const self = this as any as {{contractName}}Contract;
|
||||
const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs;
|
||||
[{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [{{> params inputs=inputs}}]);
|
||||
const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}.encode([{{> params inputs=inputs}}]);
|
||||
const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -33,9 +30,7 @@ public {{this.tsName}} = {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as {{contractName}}Contract;
|
||||
const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs;
|
||||
[{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}.encode([{{> params inputs=inputs}}]);
|
||||
const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -51,9 +46,7 @@ public {{this.tsName}} = {
|
||||
{{> typed_params inputs=inputs}}
|
||||
): string {
|
||||
const self = this as any as {{contractName}}Contract;
|
||||
const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs;
|
||||
[{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}.encode([{{> params inputs=inputs}}]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
{{> callAsync}}
|
||||
|
@@ -1,4 +1,23 @@
|
||||
[
|
||||
{
|
||||
"version": "2.2.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Added `MultiAssetProxy`",
|
||||
"pr": 1503
|
||||
}
|
||||
],
|
||||
"timestamp": 1547561734
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "2.1.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.0",
|
||||
"changes": [
|
||||
@@ -41,8 +60,7 @@
|
||||
"version": "1.1.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"`deployFrom0xArtifactAsync` additionally accepts artifacts that conform to the `SimpleContractArtifact` interface",
|
||||
"note": "`deployFrom0xArtifactAsync` additionally accepts artifacts that conform to the `SimpleContractArtifact` interface",
|
||||
"pr": 1298
|
||||
}
|
||||
],
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.2.0 - _January 15, 2019_
|
||||
|
||||
* Added `MultiAssetProxy` (#1503)
|
||||
|
||||
## v2.1.1 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.0 - _January 9, 2019_
|
||||
|
||||
* Added Dutch Auction Wrapper (#1465)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-wrappers",
|
||||
"version": "2.1.0",
|
||||
"version": "2.2.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -18,7 +18,7 @@
|
||||
"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"
|
||||
},
|
||||
"config": {
|
||||
"abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DutchAuction|DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IValidator|IWallet|OrderValidator|WETH9|ZRXToken).json"
|
||||
"abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DutchAuction|DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IValidator|IWallet|MultiAssetProxy|OrderValidator|WETH9|ZRXToken).json"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -30,19 +30,19 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.20",
|
||||
"@0x/abi-gen-templates": "^1.0.1",
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/types": "^1.5.0",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/web3-wrapper": "^3.2.2",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"@0x/abi-gen": "^1.0.22",
|
||||
"@0x/abi-gen-templates": "^1.0.2",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@0x/types": "^1.5.2",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"@0x/web3-wrapper": "^3.2.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.5",
|
||||
"shx": "^0.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^3.0.11"
|
||||
"@0x/base-contract": "^3.0.13"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -43,12 +43,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'name()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.name;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('name()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -59,11 +54,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'name'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('name()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public approve = {
|
||||
@@ -73,16 +69,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_spender,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_spender,
|
||||
_value
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -107,13 +94,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_spender,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -132,13 +113,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_spender,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -151,18 +126,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'approve(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_spender,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_spender,
|
||||
_value
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.approve;
|
||||
const encodedData = ethersFunction.encode([_spender,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -175,11 +139,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'approve'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public totalSupply = {
|
||||
@@ -189,12 +154,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'totalSupply()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.totalSupply;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('totalSupply()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -205,11 +165,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'totalSupply'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transferFrom = {
|
||||
@@ -220,19 +181,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
@@ -260,15 +209,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
@@ -289,15 +230,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
@@ -312,21 +245,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'transferFrom(address,address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferFrom;
|
||||
const encodedData = ethersFunction.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
@@ -340,11 +259,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transferFrom'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public decimals = {
|
||||
@@ -354,12 +274,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'decimals()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.decimals;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('decimals()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -370,11 +285,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'decimals'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('decimals()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public balanceOf = {
|
||||
@@ -385,15 +301,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'balanceOf(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_owner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.balanceOf;
|
||||
const encodedData = ethersFunction.encode([_owner
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -405,11 +313,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'balanceOf'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public owner = {
|
||||
@@ -419,12 +328,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'owner()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.owner;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('owner()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -435,11 +339,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'owner'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public symbol = {
|
||||
@@ -449,12 +354,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'symbol()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.symbol;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('symbol()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -465,11 +365,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'symbol'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('symbol()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public mint = {
|
||||
@@ -478,13 +379,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('mint(uint256)').inputs;
|
||||
[_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_value
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('mint(uint256)').functions.mint.encode([_value
|
||||
const encodedData = self._strictEncodeArguments('mint(uint256)', [_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -506,11 +401,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('mint(uint256)').inputs;
|
||||
[_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('mint(uint256)').functions.mint.encode([_value
|
||||
const encodedData = self._strictEncodeArguments('mint(uint256)', [_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -527,11 +418,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('mint(uint256)').inputs;
|
||||
[_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('mint(uint256)').functions.mint.encode([_value
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('mint(uint256)', [_value
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -542,15 +429,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'mint(uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_value
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.mint;
|
||||
const encodedData = ethersFunction.encode([_value
|
||||
const encodedData = self._strictEncodeArguments('mint(uint256)', [_value
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -562,11 +441,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'mint'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('mint(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transfer = {
|
||||
@@ -576,16 +456,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
|
||||
[_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
|
||||
_value
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -610,13 +481,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
|
||||
[_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -635,13 +500,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
|
||||
[_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -654,18 +513,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'transfer(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
|
||||
_value
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transfer;
|
||||
const encodedData = ethersFunction.encode([_to,
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -678,11 +526,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transfer'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public allowance = {
|
||||
@@ -694,18 +543,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'allowance(address,address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_owner,
|
||||
_spender
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
|
||||
_spender
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
|
||||
_spender
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.allowance;
|
||||
const encodedData = ethersFunction.encode([_owner,
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner,
|
||||
_spender
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -718,11 +556,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'allowance'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public setBalance = {
|
||||
@@ -732,16 +571,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('setBalance(address,uint256)').inputs;
|
||||
[_target,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_target,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_target,
|
||||
_value
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('setBalance(address,uint256)').functions.setBalance.encode([_target,
|
||||
const encodedData = self._strictEncodeArguments('setBalance(address,uint256)', [_target,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -766,13 +596,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('setBalance(address,uint256)').inputs;
|
||||
[_target,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_target,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('setBalance(address,uint256)').functions.setBalance.encode([_target,
|
||||
const encodedData = self._strictEncodeArguments('setBalance(address,uint256)', [_target,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -791,13 +615,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('setBalance(address,uint256)').inputs;
|
||||
[_target,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_target,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('setBalance(address,uint256)').functions.setBalance.encode([_target,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('setBalance(address,uint256)', [_target,
|
||||
_value
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -810,18 +628,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'setBalance(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_target,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_target,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_target,
|
||||
_value
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.setBalance;
|
||||
const encodedData = ethersFunction.encode([_target,
|
||||
const encodedData = self._strictEncodeArguments('setBalance(address,uint256)', [_target,
|
||||
_value
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -834,11 +641,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'setBalance'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('setBalance(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
@@ -847,13 +655,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -875,11 +677,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -896,11 +694,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
newOwner: string,
|
||||
): string {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -911,15 +705,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'transferOwnership(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferOwnership;
|
||||
const encodedData = ethersFunction.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -931,11 +717,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transferOwnership'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public MAX_MINT_AMOUNT = {
|
||||
@@ -945,12 +732,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as DummyERC20TokenContract;
|
||||
const functionSignature = 'MAX_MINT_AMOUNT()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.MAX_MINT_AMOUNT;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('MAX_MINT_AMOUNT()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -961,11 +743,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'MAX_MINT_AMOUNT'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('MAX_MINT_AMOUNT()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -1039,7 +822,7 @@ _totalSupply
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('DummyERC20Token', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -51,12 +51,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'name()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.name;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('name()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -67,11 +62,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'name'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('name()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getApproved = {
|
||||
@@ -82,15 +78,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'getApproved(uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getApproved;
|
||||
const encodedData = ethersFunction.encode([_tokenId
|
||||
const encodedData = self._strictEncodeArguments('getApproved(uint256)', [_tokenId
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -102,11 +90,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getApproved'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('getApproved(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public approve = {
|
||||
@@ -116,16 +105,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_approved,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_approved,
|
||||
_tokenId
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_approved,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
|
||||
_tokenId
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -150,13 +130,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_approved,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_approved,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
|
||||
_tokenId
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -175,13 +149,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
_tokenId: BigNumber,
|
||||
): string {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_approved,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_approved,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
|
||||
_tokenId
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -194,18 +162,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'approve(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_approved,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_approved,
|
||||
_tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.approve;
|
||||
const encodedData = ethersFunction.encode([_approved,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
|
||||
_tokenId
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -218,11 +175,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'approve'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transferFrom = {
|
||||
@@ -233,19 +191,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -273,15 +219,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -302,15 +240,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
_tokenId: BigNumber,
|
||||
): string {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -325,21 +255,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'transferFrom(address,address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferFrom;
|
||||
const encodedData = ethersFunction.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -353,11 +269,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transferFrom'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public mint = {
|
||||
@@ -367,16 +284,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('mint(address,uint256)').inputs;
|
||||
[_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
|
||||
_tokenId
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('mint(address,uint256)').functions.mint.encode([_to,
|
||||
const encodedData = self._strictEncodeArguments('mint(address,uint256)', [_to,
|
||||
_tokenId
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -401,13 +309,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('mint(address,uint256)').inputs;
|
||||
[_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('mint(address,uint256)').functions.mint.encode([_to,
|
||||
const encodedData = self._strictEncodeArguments('mint(address,uint256)', [_to,
|
||||
_tokenId
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -426,13 +328,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
_tokenId: BigNumber,
|
||||
): string {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('mint(address,uint256)').inputs;
|
||||
[_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('mint(address,uint256)').functions.mint.encode([_to,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('mint(address,uint256)', [_to,
|
||||
_tokenId
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -445,18 +341,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'mint(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
|
||||
_tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.mint;
|
||||
const encodedData = ethersFunction.encode([_to,
|
||||
const encodedData = self._strictEncodeArguments('mint(address,uint256)', [_to,
|
||||
_tokenId
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -469,11 +354,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'mint'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('mint(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public safeTransferFrom1 = {
|
||||
@@ -484,19 +370,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256)').functions.safeTransferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -524,15 +398,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256)').functions.safeTransferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -553,15 +419,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
_tokenId: BigNumber,
|
||||
): string {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256)').functions.safeTransferFrom.encode([_from,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -576,21 +434,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'safeTransferFrom(address,address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.safeTransferFrom;
|
||||
const encodedData = ethersFunction.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -604,11 +448,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'safeTransferFrom'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public ownerOf = {
|
||||
@@ -619,15 +464,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'ownerOf(uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.ownerOf;
|
||||
const encodedData = ethersFunction.encode([_tokenId
|
||||
const encodedData = self._strictEncodeArguments('ownerOf(uint256)', [_tokenId
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -639,11 +476,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'ownerOf'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('ownerOf(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public balanceOf = {
|
||||
@@ -654,15 +492,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'balanceOf(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_owner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.balanceOf;
|
||||
const encodedData = ethersFunction.encode([_owner
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -674,11 +504,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'balanceOf'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public owner = {
|
||||
@@ -688,12 +519,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'owner()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.owner;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('owner()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -704,11 +530,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'owner'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public symbol = {
|
||||
@@ -718,12 +545,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'symbol()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.symbol;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('symbol()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -734,11 +556,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'symbol'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('symbol()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public burn = {
|
||||
@@ -748,16 +571,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('burn(address,uint256)').inputs;
|
||||
[_owner,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
|
||||
_tokenId
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('burn(address,uint256)').functions.burn.encode([_owner,
|
||||
const encodedData = self._strictEncodeArguments('burn(address,uint256)', [_owner,
|
||||
_tokenId
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -782,13 +596,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('burn(address,uint256)').inputs;
|
||||
[_owner,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('burn(address,uint256)').functions.burn.encode([_owner,
|
||||
const encodedData = self._strictEncodeArguments('burn(address,uint256)', [_owner,
|
||||
_tokenId
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -807,13 +615,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
_tokenId: BigNumber,
|
||||
): string {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('burn(address,uint256)').inputs;
|
||||
[_owner,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('burn(address,uint256)').functions.burn.encode([_owner,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('burn(address,uint256)', [_owner,
|
||||
_tokenId
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -826,18 +628,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'burn(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_owner,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
|
||||
_tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.burn;
|
||||
const encodedData = ethersFunction.encode([_owner,
|
||||
const encodedData = self._strictEncodeArguments('burn(address,uint256)', [_owner,
|
||||
_tokenId
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -850,11 +641,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'burn'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('burn(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public setApprovalForAll = {
|
||||
@@ -864,16 +656,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('setApprovalForAll(address,bool)').inputs;
|
||||
[_operator,
|
||||
_approved
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
|
||||
_approved
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_operator,
|
||||
_approved
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('setApprovalForAll(address,bool)').functions.setApprovalForAll.encode([_operator,
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
|
||||
_approved
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -898,13 +681,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('setApprovalForAll(address,bool)').inputs;
|
||||
[_operator,
|
||||
_approved
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
|
||||
_approved
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('setApprovalForAll(address,bool)').functions.setApprovalForAll.encode([_operator,
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
|
||||
_approved
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -923,13 +700,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
_approved: boolean,
|
||||
): string {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('setApprovalForAll(address,bool)').inputs;
|
||||
[_operator,
|
||||
_approved
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
|
||||
_approved
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('setApprovalForAll(address,bool)').functions.setApprovalForAll.encode([_operator,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
|
||||
_approved
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -942,18 +713,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'setApprovalForAll(address,bool)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_operator,
|
||||
_approved
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
|
||||
_approved
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_operator,
|
||||
_approved
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.setApprovalForAll;
|
||||
const encodedData = ethersFunction.encode([_operator,
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
|
||||
_approved
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -966,11 +726,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'setApprovalForAll'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('setApprovalForAll(address,bool)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public safeTransferFrom2 = {
|
||||
@@ -982,22 +743,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256,bytes)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256,bytes)').functions.safeTransferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
@@ -1028,17 +774,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256,bytes)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256,bytes)').functions.safeTransferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
@@ -1061,17 +797,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
_data: string,
|
||||
): string {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256,bytes)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256,bytes)').functions.safeTransferFrom.encode([_from,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
@@ -1088,24 +814,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'safeTransferFrom(address,address,uint256,bytes)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.safeTransferFrom;
|
||||
const encodedData = ethersFunction.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
@@ -1120,11 +829,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'safeTransferFrom'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public isApprovedForAll = {
|
||||
@@ -1136,18 +846,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'isApprovedForAll(address,address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_owner,
|
||||
_operator
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
|
||||
_operator
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
|
||||
_operator
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.isApprovedForAll;
|
||||
const encodedData = ethersFunction.encode([_owner,
|
||||
const encodedData = self._strictEncodeArguments('isApprovedForAll(address,address)', [_owner,
|
||||
_operator
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -1160,11 +859,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'isApprovedForAll'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('isApprovedForAll(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
@@ -1173,13 +873,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -1201,11 +895,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -1222,11 +912,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
newOwner: string,
|
||||
): string {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -1237,15 +923,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as DummyERC721TokenContract;
|
||||
const functionSignature = 'transferOwnership(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferOwnership;
|
||||
const encodedData = ethersFunction.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -1257,11 +935,12 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transferOwnership'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -1321,7 +1000,7 @@ _symbol
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('DummyERC721Token', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -21,13 +21,7 @@ export class DutchAuctionContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const inputAbi = self._lookupAbi('getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').inputs;
|
||||
[order
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [order
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [order
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').functions.getAuctionDetails.encode([order
|
||||
const encodedData = self._strictEncodeArguments('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -49,11 +43,7 @@ export class DutchAuctionContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const inputAbi = self._lookupAbi('getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').inputs;
|
||||
[order
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [order
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').functions.getAuctionDetails.encode([order
|
||||
const encodedData = self._strictEncodeArguments('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -70,11 +60,7 @@ export class DutchAuctionContract extends BaseContract {
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
): string {
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const inputAbi = self._lookupAbi('getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').inputs;
|
||||
[order
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [order
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').functions.getAuctionDetails.encode([order
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -85,15 +71,7 @@ export class DutchAuctionContract extends BaseContract {
|
||||
): Promise<{beginTimeSeconds: BigNumber;endTimeSeconds: BigNumber;beginAmount: BigNumber;endAmount: BigNumber;currentAmount: BigNumber;currentTimeSeconds: BigNumber}
|
||||
> {
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const functionSignature = 'getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[order
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [order
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [order
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getAuctionDetails;
|
||||
const encodedData = ethersFunction.encode([order
|
||||
const encodedData = self._strictEncodeArguments('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -105,11 +83,12 @@ export class DutchAuctionContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getAuctionDetails'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<{beginTimeSeconds: BigNumber;endTimeSeconds: BigNumber;beginAmount: BigNumber;endAmount: BigNumber;currentAmount: BigNumber;currentTimeSeconds: BigNumber}
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public matchOrders = {
|
||||
@@ -121,22 +100,7 @@ export class DutchAuctionContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const inputAbi = self._lookupAbi('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').inputs;
|
||||
[buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').functions.matchOrders.encode([buyOrder,
|
||||
const encodedData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
@@ -167,17 +131,7 @@ export class DutchAuctionContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const inputAbi = self._lookupAbi('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').inputs;
|
||||
[buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').functions.matchOrders.encode([buyOrder,
|
||||
const encodedData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
@@ -200,17 +154,7 @@ export class DutchAuctionContract extends BaseContract {
|
||||
sellSignature: string,
|
||||
): string {
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const inputAbi = self._lookupAbi('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').inputs;
|
||||
[buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').functions.matchOrders.encode([buyOrder,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
@@ -227,24 +171,7 @@ export class DutchAuctionContract extends BaseContract {
|
||||
): Promise<{left: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};right: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};leftMakerAssetSpreadAmount: BigNumber}
|
||||
> {
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const functionSignature = 'matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.matchOrders;
|
||||
const encodedData = ethersFunction.encode([buyOrder,
|
||||
const encodedData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
@@ -259,11 +186,12 @@ export class DutchAuctionContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'matchOrders'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<{left: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};right: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};leftMakerAssetSpreadAmount: BigNumber}
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -316,7 +244,7 @@ export class DutchAuctionContract extends BaseContract {
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('DutchAuction', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -40,13 +40,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const inputAbi = self._lookupAbi('addAuthorizedAddress(address)').inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('addAuthorizedAddress(address)').functions.addAuthorizedAddress.encode([target
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -68,11 +62,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const inputAbi = self._lookupAbi('addAuthorizedAddress(address)').inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('addAuthorizedAddress(address)').functions.addAuthorizedAddress.encode([target
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -89,11 +79,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
target: string,
|
||||
): string {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const inputAbi = self._lookupAbi('addAuthorizedAddress(address)').inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('addAuthorizedAddress(address)').functions.addAuthorizedAddress.encode([target
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -104,15 +90,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const functionSignature = 'addAuthorizedAddress(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.addAuthorizedAddress;
|
||||
const encodedData = ethersFunction.encode([target
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -124,11 +102,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'addAuthorizedAddress'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public authorities = {
|
||||
@@ -139,15 +118,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const functionSignature = 'authorities(uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[index_0
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [index_0
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.authorities;
|
||||
const encodedData = ethersFunction.encode([index_0
|
||||
const encodedData = self._strictEncodeArguments('authorities(uint256)', [index_0
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -159,11 +130,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'authorities'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public removeAuthorizedAddress = {
|
||||
@@ -172,13 +144,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const inputAbi = self._lookupAbi('removeAuthorizedAddress(address)').inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('removeAuthorizedAddress(address)').functions.removeAuthorizedAddress.encode([target
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -200,11 +166,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const inputAbi = self._lookupAbi('removeAuthorizedAddress(address)').inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('removeAuthorizedAddress(address)').functions.removeAuthorizedAddress.encode([target
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -221,11 +183,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
target: string,
|
||||
): string {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const inputAbi = self._lookupAbi('removeAuthorizedAddress(address)').inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('removeAuthorizedAddress(address)').functions.removeAuthorizedAddress.encode([target
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -236,15 +194,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const functionSignature = 'removeAuthorizedAddress(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.removeAuthorizedAddress;
|
||||
const encodedData = ethersFunction.encode([target
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -256,11 +206,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'removeAuthorizedAddress'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public owner = {
|
||||
@@ -270,12 +221,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const functionSignature = 'owner()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.owner;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('owner()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -286,11 +232,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'owner'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public removeAuthorizedAddressAtIndex = {
|
||||
@@ -300,16 +247,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const inputAbi = self._lookupAbi('removeAuthorizedAddressAtIndex(address,uint256)').inputs;
|
||||
[target,
|
||||
index
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target,
|
||||
index
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target,
|
||||
index
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('removeAuthorizedAddressAtIndex(address,uint256)').functions.removeAuthorizedAddressAtIndex.encode([target,
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -334,13 +272,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const inputAbi = self._lookupAbi('removeAuthorizedAddressAtIndex(address,uint256)').inputs;
|
||||
[target,
|
||||
index
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target,
|
||||
index
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('removeAuthorizedAddressAtIndex(address,uint256)').functions.removeAuthorizedAddressAtIndex.encode([target,
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -359,13 +291,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
index: BigNumber,
|
||||
): string {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const inputAbi = self._lookupAbi('removeAuthorizedAddressAtIndex(address,uint256)').inputs;
|
||||
[target,
|
||||
index
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target,
|
||||
index
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('removeAuthorizedAddressAtIndex(address,uint256)').functions.removeAuthorizedAddressAtIndex.encode([target,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -378,18 +304,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const functionSignature = 'removeAuthorizedAddressAtIndex(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[target,
|
||||
index
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target,
|
||||
index
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target,
|
||||
index
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.removeAuthorizedAddressAtIndex;
|
||||
const encodedData = ethersFunction.encode([target,
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -402,11 +317,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'removeAuthorizedAddressAtIndex'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getProxyId = {
|
||||
@@ -416,12 +332,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const functionSignature = 'getProxyId()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getProxyId;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('getProxyId()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -432,11 +343,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getProxyId'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public authorized = {
|
||||
@@ -447,15 +359,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const functionSignature = 'authorized(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[index_0
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [index_0
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.authorized;
|
||||
const encodedData = ethersFunction.encode([index_0
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -467,11 +371,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'authorized'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('authorized(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getAuthorizedAddresses = {
|
||||
@@ -481,12 +386,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): Promise<string[]
|
||||
> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const functionSignature = 'getAuthorizedAddresses()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getAuthorizedAddresses;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -497,11 +397,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getAuthorizedAddresses'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string[]
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
@@ -510,13 +411,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -538,11 +433,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -559,11 +450,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
newOwner: string,
|
||||
): string {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -574,15 +461,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const functionSignature = 'transferOwnership(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferOwnership;
|
||||
const encodedData = ethersFunction.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -594,11 +473,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transferOwnership'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -644,7 +524,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('ERC20Proxy', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -43,16 +43,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_spender,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_spender,
|
||||
_value
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -77,13 +68,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_spender,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -102,13 +87,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_spender,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -121,18 +100,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const functionSignature = 'approve(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_spender,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_spender,
|
||||
_value
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.approve;
|
||||
const encodedData = ethersFunction.encode([_spender,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -145,11 +113,12 @@ export class ERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'approve'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public totalSupply = {
|
||||
@@ -159,12 +128,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const functionSignature = 'totalSupply()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.totalSupply;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('totalSupply()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -175,11 +139,12 @@ export class ERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'totalSupply'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transferFrom = {
|
||||
@@ -190,19 +155,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
@@ -230,15 +183,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
@@ -259,15 +204,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
@@ -282,21 +219,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const functionSignature = 'transferFrom(address,address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferFrom;
|
||||
const encodedData = ethersFunction.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
@@ -310,11 +233,12 @@ export class ERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transferFrom'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public balanceOf = {
|
||||
@@ -325,15 +249,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const functionSignature = 'balanceOf(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_owner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.balanceOf;
|
||||
const encodedData = ethersFunction.encode([_owner
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -345,11 +261,12 @@ export class ERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'balanceOf'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transfer = {
|
||||
@@ -359,16 +276,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
|
||||
[_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
|
||||
_value
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -393,13 +301,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
|
||||
[_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -418,13 +320,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
|
||||
[_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -437,18 +333,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const functionSignature = 'transfer(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
|
||||
_value
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transfer;
|
||||
const encodedData = ethersFunction.encode([_to,
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -461,11 +346,12 @@ export class ERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transfer'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public allowance = {
|
||||
@@ -477,18 +363,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const functionSignature = 'allowance(address,address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_owner,
|
||||
_spender
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
|
||||
_spender
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
|
||||
_spender
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.allowance;
|
||||
const encodedData = ethersFunction.encode([_owner,
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner,
|
||||
_spender
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -501,11 +376,12 @@ export class ERC20TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'allowance'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -551,7 +427,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('ERC20Token', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -40,13 +40,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const inputAbi = self._lookupAbi('addAuthorizedAddress(address)').inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('addAuthorizedAddress(address)').functions.addAuthorizedAddress.encode([target
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -68,11 +62,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const inputAbi = self._lookupAbi('addAuthorizedAddress(address)').inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('addAuthorizedAddress(address)').functions.addAuthorizedAddress.encode([target
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -89,11 +79,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
target: string,
|
||||
): string {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const inputAbi = self._lookupAbi('addAuthorizedAddress(address)').inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('addAuthorizedAddress(address)').functions.addAuthorizedAddress.encode([target
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -104,15 +90,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const functionSignature = 'addAuthorizedAddress(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.addAuthorizedAddress;
|
||||
const encodedData = ethersFunction.encode([target
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -124,11 +102,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'addAuthorizedAddress'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public authorities = {
|
||||
@@ -139,15 +118,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const functionSignature = 'authorities(uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[index_0
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [index_0
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.authorities;
|
||||
const encodedData = ethersFunction.encode([index_0
|
||||
const encodedData = self._strictEncodeArguments('authorities(uint256)', [index_0
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -159,11 +130,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'authorities'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public removeAuthorizedAddress = {
|
||||
@@ -172,13 +144,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const inputAbi = self._lookupAbi('removeAuthorizedAddress(address)').inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('removeAuthorizedAddress(address)').functions.removeAuthorizedAddress.encode([target
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -200,11 +166,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const inputAbi = self._lookupAbi('removeAuthorizedAddress(address)').inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('removeAuthorizedAddress(address)').functions.removeAuthorizedAddress.encode([target
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -221,11 +183,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
target: string,
|
||||
): string {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const inputAbi = self._lookupAbi('removeAuthorizedAddress(address)').inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('removeAuthorizedAddress(address)').functions.removeAuthorizedAddress.encode([target
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -236,15 +194,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const functionSignature = 'removeAuthorizedAddress(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[target
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.removeAuthorizedAddress;
|
||||
const encodedData = ethersFunction.encode([target
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -256,11 +206,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'removeAuthorizedAddress'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public owner = {
|
||||
@@ -270,12 +221,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const functionSignature = 'owner()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.owner;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('owner()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -286,11 +232,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'owner'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public removeAuthorizedAddressAtIndex = {
|
||||
@@ -300,16 +247,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const inputAbi = self._lookupAbi('removeAuthorizedAddressAtIndex(address,uint256)').inputs;
|
||||
[target,
|
||||
index
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target,
|
||||
index
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target,
|
||||
index
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('removeAuthorizedAddressAtIndex(address,uint256)').functions.removeAuthorizedAddressAtIndex.encode([target,
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -334,13 +272,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const inputAbi = self._lookupAbi('removeAuthorizedAddressAtIndex(address,uint256)').inputs;
|
||||
[target,
|
||||
index
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target,
|
||||
index
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('removeAuthorizedAddressAtIndex(address,uint256)').functions.removeAuthorizedAddressAtIndex.encode([target,
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -359,13 +291,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
index: BigNumber,
|
||||
): string {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const inputAbi = self._lookupAbi('removeAuthorizedAddressAtIndex(address,uint256)').inputs;
|
||||
[target,
|
||||
index
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target,
|
||||
index
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('removeAuthorizedAddressAtIndex(address,uint256)').functions.removeAuthorizedAddressAtIndex.encode([target,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -378,18 +304,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const functionSignature = 'removeAuthorizedAddressAtIndex(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[target,
|
||||
index
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target,
|
||||
index
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target,
|
||||
index
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.removeAuthorizedAddressAtIndex;
|
||||
const encodedData = ethersFunction.encode([target,
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -402,11 +317,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'removeAuthorizedAddressAtIndex'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getProxyId = {
|
||||
@@ -416,12 +332,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const functionSignature = 'getProxyId()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getProxyId;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('getProxyId()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -432,11 +343,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getProxyId'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public authorized = {
|
||||
@@ -447,15 +359,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const functionSignature = 'authorized(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[index_0
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [index_0
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.authorized;
|
||||
const encodedData = ethersFunction.encode([index_0
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -467,11 +371,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'authorized'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('authorized(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getAuthorizedAddresses = {
|
||||
@@ -481,12 +386,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): Promise<string[]
|
||||
> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const functionSignature = 'getAuthorizedAddresses()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getAuthorizedAddresses;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -497,11 +397,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getAuthorizedAddresses'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string[]
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
@@ -510,13 +411,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -538,11 +433,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -559,11 +450,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
newOwner: string,
|
||||
): string {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -574,15 +461,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const functionSignature = 'transferOwnership(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferOwnership;
|
||||
const encodedData = ethersFunction.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -594,11 +473,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transferOwnership'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -644,7 +524,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('ERC721Proxy', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -52,15 +52,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const functionSignature = 'getApproved(uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getApproved;
|
||||
const encodedData = ethersFunction.encode([_tokenId
|
||||
const encodedData = self._strictEncodeArguments('getApproved(uint256)', [_tokenId
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -72,11 +64,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getApproved'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('getApproved(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public approve = {
|
||||
@@ -86,16 +79,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_approved,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_approved,
|
||||
_tokenId
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_approved,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
|
||||
_tokenId
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -120,13 +104,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_approved,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_approved,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
|
||||
_tokenId
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -145,13 +123,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
_tokenId: BigNumber,
|
||||
): string {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_approved,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_approved,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
|
||||
_tokenId
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -164,18 +136,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const functionSignature = 'approve(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_approved,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_approved,
|
||||
_tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.approve;
|
||||
const encodedData = ethersFunction.encode([_approved,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
|
||||
_tokenId
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -188,11 +149,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'approve'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transferFrom = {
|
||||
@@ -203,19 +165,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -243,15 +193,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -272,15 +214,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
_tokenId: BigNumber,
|
||||
): string {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -295,21 +229,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const functionSignature = 'transferFrom(address,address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferFrom;
|
||||
const encodedData = ethersFunction.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -323,11 +243,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transferFrom'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public safeTransferFrom1 = {
|
||||
@@ -338,19 +259,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256)').functions.safeTransferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -378,15 +287,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256)').functions.safeTransferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -407,15 +308,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
_tokenId: BigNumber,
|
||||
): string {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256)').functions.safeTransferFrom.encode([_from,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -430,21 +323,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const functionSignature = 'safeTransferFrom(address,address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.safeTransferFrom;
|
||||
const encodedData = ethersFunction.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_tokenId
|
||||
]);
|
||||
@@ -458,11 +337,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'safeTransferFrom'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public ownerOf = {
|
||||
@@ -473,15 +353,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const functionSignature = 'ownerOf(uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.ownerOf;
|
||||
const encodedData = ethersFunction.encode([_tokenId
|
||||
const encodedData = self._strictEncodeArguments('ownerOf(uint256)', [_tokenId
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -493,11 +365,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'ownerOf'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('ownerOf(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public balanceOf = {
|
||||
@@ -508,15 +381,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const functionSignature = 'balanceOf(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_owner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.balanceOf;
|
||||
const encodedData = ethersFunction.encode([_owner
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -528,11 +393,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'balanceOf'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public setApprovalForAll = {
|
||||
@@ -542,16 +408,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('setApprovalForAll(address,bool)').inputs;
|
||||
[_operator,
|
||||
_approved
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
|
||||
_approved
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_operator,
|
||||
_approved
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('setApprovalForAll(address,bool)').functions.setApprovalForAll.encode([_operator,
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
|
||||
_approved
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -576,13 +433,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('setApprovalForAll(address,bool)').inputs;
|
||||
[_operator,
|
||||
_approved
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
|
||||
_approved
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('setApprovalForAll(address,bool)').functions.setApprovalForAll.encode([_operator,
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
|
||||
_approved
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -601,13 +452,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
_approved: boolean,
|
||||
): string {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('setApprovalForAll(address,bool)').inputs;
|
||||
[_operator,
|
||||
_approved
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
|
||||
_approved
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('setApprovalForAll(address,bool)').functions.setApprovalForAll.encode([_operator,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
|
||||
_approved
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -620,18 +465,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const functionSignature = 'setApprovalForAll(address,bool)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_operator,
|
||||
_approved
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
|
||||
_approved
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_operator,
|
||||
_approved
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.setApprovalForAll;
|
||||
const encodedData = ethersFunction.encode([_operator,
|
||||
const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
|
||||
_approved
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -644,11 +478,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'setApprovalForAll'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('setApprovalForAll(address,bool)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public safeTransferFrom2 = {
|
||||
@@ -660,22 +495,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256,bytes)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256,bytes)').functions.safeTransferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
@@ -706,17 +526,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256,bytes)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256,bytes)').functions.safeTransferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
@@ -739,17 +549,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
_data: string,
|
||||
): string {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256,bytes)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256,bytes)').functions.safeTransferFrom.encode([_from,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
@@ -766,24 +566,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const functionSignature = 'safeTransferFrom(address,address,uint256,bytes)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.safeTransferFrom;
|
||||
const encodedData = ethersFunction.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data
|
||||
@@ -798,11 +581,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'safeTransferFrom'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public isApprovedForAll = {
|
||||
@@ -814,18 +598,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as ERC721TokenContract;
|
||||
const functionSignature = 'isApprovedForAll(address,address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_owner,
|
||||
_operator
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
|
||||
_operator
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
|
||||
_operator
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.isApprovedForAll;
|
||||
const encodedData = ethersFunction.encode([_owner,
|
||||
const encodedData = self._strictEncodeArguments('isApprovedForAll(address,address)', [_owner,
|
||||
_operator
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -838,11 +611,12 @@ export class ERC721TokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'isApprovedForAll'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('isApprovedForAll(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -888,7 +662,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('ERC721Token', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -27,31 +27,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txData: Partial<TxDataPayable> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const inputAbi = self._lookupAbi('marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)').inputs;
|
||||
[orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)').functions.marketBuyOrdersWithEth.encode([orders,
|
||||
const encodedData = self._strictEncodeArguments('marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
@@ -91,23 +67,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const inputAbi = self._lookupAbi('marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)').inputs;
|
||||
[orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)').functions.marketBuyOrdersWithEth.encode([orders,
|
||||
const encodedData = self._strictEncodeArguments('marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
@@ -136,23 +96,7 @@ export class ForwarderContract extends BaseContract {
|
||||
feeRecipient: string,
|
||||
): string {
|
||||
const self = this as any as ForwarderContract;
|
||||
const inputAbi = self._lookupAbi('marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)').inputs;
|
||||
[orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)').functions.marketBuyOrdersWithEth.encode([orders,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
@@ -175,33 +119,7 @@ export class ForwarderContract extends BaseContract {
|
||||
): Promise<[{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}, {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}]
|
||||
> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const functionSignature = 'marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.marketBuyOrdersWithEth;
|
||||
const encodedData = ethersFunction.encode([orders,
|
||||
const encodedData = self._strictEncodeArguments('marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
@@ -219,11 +137,12 @@ export class ForwarderContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'marketBuyOrdersWithEth'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<[{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}, {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}]
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public withdrawAsset = {
|
||||
@@ -233,16 +152,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const inputAbi = self._lookupAbi('withdrawAsset(bytes,uint256)').inputs;
|
||||
[assetData,
|
||||
amount
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [assetData,
|
||||
amount
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [assetData,
|
||||
amount
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('withdrawAsset(bytes,uint256)').functions.withdrawAsset.encode([assetData,
|
||||
const encodedData = self._strictEncodeArguments('withdrawAsset(bytes,uint256)', [assetData,
|
||||
amount
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -267,13 +177,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const inputAbi = self._lookupAbi('withdrawAsset(bytes,uint256)').inputs;
|
||||
[assetData,
|
||||
amount
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [assetData,
|
||||
amount
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('withdrawAsset(bytes,uint256)').functions.withdrawAsset.encode([assetData,
|
||||
const encodedData = self._strictEncodeArguments('withdrawAsset(bytes,uint256)', [assetData,
|
||||
amount
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -292,13 +196,7 @@ export class ForwarderContract extends BaseContract {
|
||||
amount: BigNumber,
|
||||
): string {
|
||||
const self = this as any as ForwarderContract;
|
||||
const inputAbi = self._lookupAbi('withdrawAsset(bytes,uint256)').inputs;
|
||||
[assetData,
|
||||
amount
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [assetData,
|
||||
amount
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('withdrawAsset(bytes,uint256)').functions.withdrawAsset.encode([assetData,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('withdrawAsset(bytes,uint256)', [assetData,
|
||||
amount
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -311,18 +209,7 @@ export class ForwarderContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const functionSignature = 'withdrawAsset(bytes,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[assetData,
|
||||
amount
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [assetData,
|
||||
amount
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [assetData,
|
||||
amount
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.withdrawAsset;
|
||||
const encodedData = ethersFunction.encode([assetData,
|
||||
const encodedData = self._strictEncodeArguments('withdrawAsset(bytes,uint256)', [assetData,
|
||||
amount
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -335,11 +222,12 @@ export class ForwarderContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'withdrawAsset'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('withdrawAsset(bytes,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public owner = {
|
||||
@@ -349,12 +237,7 @@ export class ForwarderContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const functionSignature = 'owner()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.owner;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('owner()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -365,11 +248,12 @@ export class ForwarderContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'owner'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public marketSellOrdersWithEth = {
|
||||
@@ -383,28 +267,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txData: Partial<TxDataPayable> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const inputAbi = self._lookupAbi('marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)').inputs;
|
||||
[orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)').functions.marketSellOrdersWithEth.encode([orders,
|
||||
const encodedData = self._strictEncodeArguments('marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
@@ -441,21 +304,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const inputAbi = self._lookupAbi('marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)').inputs;
|
||||
[orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)').functions.marketSellOrdersWithEth.encode([orders,
|
||||
const encodedData = self._strictEncodeArguments('marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
@@ -482,21 +331,7 @@ export class ForwarderContract extends BaseContract {
|
||||
feeRecipient: string,
|
||||
): string {
|
||||
const self = this as any as ForwarderContract;
|
||||
const inputAbi = self._lookupAbi('marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)').inputs;
|
||||
[orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)').functions.marketSellOrdersWithEth.encode([orders,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
@@ -517,30 +352,7 @@ export class ForwarderContract extends BaseContract {
|
||||
): Promise<[{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}, {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}]
|
||||
> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const functionSignature = 'marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.marketSellOrdersWithEth;
|
||||
const encodedData = ethersFunction.encode([orders,
|
||||
const encodedData = self._strictEncodeArguments('marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
@@ -557,11 +369,12 @@ export class ForwarderContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'marketSellOrdersWithEth'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<[{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}, {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}]
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
@@ -570,13 +383,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -598,11 +405,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -619,11 +422,7 @@ export class ForwarderContract extends BaseContract {
|
||||
newOwner: string,
|
||||
): string {
|
||||
const self = this as any as ForwarderContract;
|
||||
const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -634,15 +433,7 @@ export class ForwarderContract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as ForwarderContract;
|
||||
const functionSignature = 'transferOwnership(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[newOwner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferOwnership;
|
||||
const encodedData = ethersFunction.encode([newOwner
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -654,11 +445,12 @@ export class ForwarderContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transferOwnership'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -725,7 +517,7 @@ _wethAssetData
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('Forwarder', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -25,21 +25,7 @@ export class IValidatorContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as IValidatorContract;
|
||||
const functionSignature = 'isValidSignature(bytes32,address,bytes)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[hash,
|
||||
signerAddress,
|
||||
signature
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [hash,
|
||||
signerAddress,
|
||||
signature
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [hash,
|
||||
signerAddress,
|
||||
signature
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.isValidSignature;
|
||||
const encodedData = ethersFunction.encode([hash,
|
||||
const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [hash,
|
||||
signerAddress,
|
||||
signature
|
||||
]);
|
||||
@@ -53,11 +39,12 @@ export class IValidatorContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'isValidSignature'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,address,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -103,7 +90,7 @@ export class IValidatorContract extends BaseContract {
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('IValidator', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -24,18 +24,7 @@ export class IWalletContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as IWalletContract;
|
||||
const functionSignature = 'isValidSignature(bytes32,bytes)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[hash,
|
||||
signature
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [hash,
|
||||
signature
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [hash,
|
||||
signature
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.isValidSignature;
|
||||
const encodedData = ethersFunction.encode([hash,
|
||||
const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,bytes)', [hash,
|
||||
signature
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -48,11 +37,12 @@ export class IWalletContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'isValidSignature'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -98,7 +88,7 @@ export class IWalletContract extends BaseContract {
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('IWallet', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -0,0 +1,669 @@
|
||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
|
||||
// tslint:disable:no-unused-variable
|
||||
// tslint:disable:no-unbound-method
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type MultiAssetProxyEventArgs =
|
||||
| MultiAssetProxyAuthorizedAddressAddedEventArgs
|
||||
| MultiAssetProxyAuthorizedAddressRemovedEventArgs
|
||||
| MultiAssetProxyAssetProxyRegisteredEventArgs;
|
||||
|
||||
export enum MultiAssetProxyEvents {
|
||||
AuthorizedAddressAdded = 'AuthorizedAddressAdded',
|
||||
AuthorizedAddressRemoved = 'AuthorizedAddressRemoved',
|
||||
AssetProxyRegistered = 'AssetProxyRegistered',
|
||||
}
|
||||
|
||||
export interface MultiAssetProxyAuthorizedAddressAddedEventArgs extends DecodedLogArgs {
|
||||
target: string;
|
||||
caller: string;
|
||||
}
|
||||
|
||||
export interface MultiAssetProxyAuthorizedAddressRemovedEventArgs extends DecodedLogArgs {
|
||||
target: string;
|
||||
caller: string;
|
||||
}
|
||||
|
||||
export interface MultiAssetProxyAssetProxyRegisteredEventArgs extends DecodedLogArgs {
|
||||
id: string;
|
||||
assetProxy: string;
|
||||
}
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class MultiAssetProxyContract extends BaseContract {
|
||||
public assetProxies = {
|
||||
async callAsync(
|
||||
index_0: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('assetProxies(bytes4)', [index_0
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...callData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('assetProxies(bytes4)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public addAuthorizedAddress = {
|
||||
async sendTransactionAsync(
|
||||
target: string,
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...txData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(
|
||||
self,
|
||||
target
|
||||
),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...txData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
target: string,
|
||||
): string {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
async callAsync(
|
||||
target: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...callData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public authorities = {
|
||||
async callAsync(
|
||||
index_0: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorities(uint256)', [index_0
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...callData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getAssetProxy = {
|
||||
async callAsync(
|
||||
assetProxyId: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('getAssetProxy(bytes4)', [assetProxyId
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...callData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getAssetProxy(bytes4)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public removeAuthorizedAddress = {
|
||||
async sendTransactionAsync(
|
||||
target: string,
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...txData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(
|
||||
self,
|
||||
target
|
||||
),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...txData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
target: string,
|
||||
): string {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
async callAsync(
|
||||
target: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...callData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public owner = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('owner()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...callData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public removeAuthorizedAddressAtIndex = {
|
||||
async sendTransactionAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...txData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(
|
||||
self,
|
||||
target,
|
||||
index
|
||||
),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...txData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
): string {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
async callAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...callData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getProxyId = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('getProxyId()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...callData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public authorized = {
|
||||
async callAsync(
|
||||
index_0: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...callData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('authorized(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public registerAssetProxy = {
|
||||
async sendTransactionAsync(
|
||||
assetProxy: string,
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...txData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.registerAssetProxy.estimateGasAsync.bind(
|
||||
self,
|
||||
assetProxy
|
||||
),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
async estimateGasAsync(
|
||||
assetProxy: string,
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...txData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
assetProxy: string,
|
||||
): string {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
async callAsync(
|
||||
assetProxy: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...callData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('registerAssetProxy(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getAuthorizedAddresses = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string[]
|
||||
> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...callData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string[]
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
async sendTransactionAsync(
|
||||
newOwner: string,
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...txData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferOwnership.estimateGasAsync.bind(
|
||||
self,
|
||||
newOwner
|
||||
),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
async estimateGasAsync(
|
||||
newOwner: string,
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...txData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
newOwner: string,
|
||||
): string {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
async callAsync(
|
||||
newOwner: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as MultiAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
...callData,
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
): Promise<MultiAssetProxyContract> {
|
||||
if (_.isUndefined(artifact.compilerOutput)) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return MultiAssetProxyContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
abi: ContractAbi,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
): Promise<MultiAssetProxyContract> {
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, []);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
txDefaults,
|
||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||
);
|
||||
const txHash = await web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
logUtils.log(`MultiAssetProxy successfully deployed at ${txReceipt.contractAddress}`);
|
||||
const contractInstance = new MultiAssetProxyContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
||||
contractInstance.constructorArgs = [];
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('MultiAssetProxy', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
@@ -24,18 +24,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
): Promise<[{orderStatus: number;orderHash: string;orderTakerAssetFilledAmount: BigNumber}, {makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}]
|
||||
> {
|
||||
const self = this as any as OrderValidatorContract;
|
||||
const functionSignature = 'getOrderAndTraderInfo({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[order,
|
||||
takerAddress
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [order,
|
||||
takerAddress
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [order,
|
||||
takerAddress
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getOrderAndTraderInfo;
|
||||
const encodedData = ethersFunction.encode([order,
|
||||
const encodedData = self._strictEncodeArguments('getOrderAndTraderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),address)', [order,
|
||||
takerAddress
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -48,11 +37,12 @@ export class OrderValidatorContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getOrderAndTraderInfo'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('getOrderAndTraderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<[{orderStatus: number;orderHash: string;orderTakerAssetFilledAmount: BigNumber}, {makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}]
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getBalanceAndAllowance = {
|
||||
@@ -64,18 +54,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
): Promise<[BigNumber, BigNumber]
|
||||
> {
|
||||
const self = this as any as OrderValidatorContract;
|
||||
const functionSignature = 'getBalanceAndAllowance(address,bytes)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[target,
|
||||
assetData
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target,
|
||||
assetData
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target,
|
||||
assetData
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getBalanceAndAllowance;
|
||||
const encodedData = ethersFunction.encode([target,
|
||||
const encodedData = self._strictEncodeArguments('getBalanceAndAllowance(address,bytes)', [target,
|
||||
assetData
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -88,11 +67,12 @@ export class OrderValidatorContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getBalanceAndAllowance'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('getBalanceAndAllowance(address,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<[BigNumber, BigNumber]
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getOrdersAndTradersInfo = {
|
||||
@@ -104,18 +84,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
): Promise<[Array<{orderStatus: number;orderHash: string;orderTakerAssetFilledAmount: BigNumber}>, Array<{makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}>]
|
||||
> {
|
||||
const self = this as any as OrderValidatorContract;
|
||||
const functionSignature = 'getOrdersAndTradersInfo(tuple[],address[])';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[orders,
|
||||
takerAddresses
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [orders,
|
||||
takerAddresses
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
|
||||
takerAddresses
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getOrdersAndTradersInfo;
|
||||
const encodedData = ethersFunction.encode([orders,
|
||||
const encodedData = self._strictEncodeArguments('getOrdersAndTradersInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address[])', [orders,
|
||||
takerAddresses
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -128,11 +97,12 @@ export class OrderValidatorContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getOrdersAndTradersInfo'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('getOrdersAndTradersInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address[])');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<[Array<{orderStatus: number;orderHash: string;orderTakerAssetFilledAmount: BigNumber}>, Array<{makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}>]
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getTradersInfo = {
|
||||
@@ -144,18 +114,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
): Promise<Array<{makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}>
|
||||
> {
|
||||
const self = this as any as OrderValidatorContract;
|
||||
const functionSignature = 'getTradersInfo(tuple[],address[])';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[orders,
|
||||
takerAddresses
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [orders,
|
||||
takerAddresses
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
|
||||
takerAddresses
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getTradersInfo;
|
||||
const encodedData = ethersFunction.encode([orders,
|
||||
const encodedData = self._strictEncodeArguments('getTradersInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address[])', [orders,
|
||||
takerAddresses
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -168,11 +127,12 @@ export class OrderValidatorContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getTradersInfo'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('getTradersInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address[])');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<Array<{makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}>
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getERC721TokenOwner = {
|
||||
@@ -184,18 +144,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as OrderValidatorContract;
|
||||
const functionSignature = 'getERC721TokenOwner(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[token,
|
||||
tokenId
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [token,
|
||||
tokenId
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [token,
|
||||
tokenId
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getERC721TokenOwner;
|
||||
const encodedData = ethersFunction.encode([token,
|
||||
const encodedData = self._strictEncodeArguments('getERC721TokenOwner(address,uint256)', [token,
|
||||
tokenId
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -208,11 +157,12 @@ export class OrderValidatorContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getERC721TokenOwner'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('getERC721TokenOwner(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getBalancesAndAllowances = {
|
||||
@@ -224,18 +174,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
): Promise<[BigNumber[], BigNumber[]]
|
||||
> {
|
||||
const self = this as any as OrderValidatorContract;
|
||||
const functionSignature = 'getBalancesAndAllowances(address,bytes[])';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[target,
|
||||
assetData
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [target,
|
||||
assetData
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [target,
|
||||
assetData
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getBalancesAndAllowances;
|
||||
const encodedData = ethersFunction.encode([target,
|
||||
const encodedData = self._strictEncodeArguments('getBalancesAndAllowances(address,bytes[])', [target,
|
||||
assetData
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -248,11 +187,12 @@ export class OrderValidatorContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getBalancesAndAllowances'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('getBalancesAndAllowances(address,bytes[])');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<[BigNumber[], BigNumber[]]
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public getTraderInfo = {
|
||||
@@ -264,18 +204,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
): Promise<{makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}
|
||||
> {
|
||||
const self = this as any as OrderValidatorContract;
|
||||
const functionSignature = 'getTraderInfo({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[order,
|
||||
takerAddress
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [order,
|
||||
takerAddress
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [order,
|
||||
takerAddress
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getTraderInfo;
|
||||
const encodedData = ethersFunction.encode([order,
|
||||
const encodedData = self._strictEncodeArguments('getTraderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),address)', [order,
|
||||
takerAddress
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -288,11 +217,12 @@ export class OrderValidatorContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'getTraderInfo'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('getTraderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<{makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -352,7 +282,7 @@ _zrxAssetData
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('OrderValidator', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -57,12 +57,7 @@ export class WETH9Contract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const functionSignature = 'name()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.name;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('name()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -73,11 +68,12 @@ export class WETH9Contract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'name'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('name()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public approve = {
|
||||
@@ -87,16 +83,7 @@ export class WETH9Contract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[guy,
|
||||
wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [guy,
|
||||
wad
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [guy,
|
||||
wad
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([guy,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [guy,
|
||||
wad
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -121,13 +108,7 @@ export class WETH9Contract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[guy,
|
||||
wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [guy,
|
||||
wad
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([guy,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [guy,
|
||||
wad
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -146,13 +127,7 @@ export class WETH9Contract extends BaseContract {
|
||||
wad: BigNumber,
|
||||
): string {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[guy,
|
||||
wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [guy,
|
||||
wad
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([guy,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [guy,
|
||||
wad
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -165,18 +140,7 @@ export class WETH9Contract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const functionSignature = 'approve(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[guy,
|
||||
wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [guy,
|
||||
wad
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [guy,
|
||||
wad
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.approve;
|
||||
const encodedData = ethersFunction.encode([guy,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [guy,
|
||||
wad
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -189,11 +153,12 @@ export class WETH9Contract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'approve'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public totalSupply = {
|
||||
@@ -203,12 +168,7 @@ export class WETH9Contract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const functionSignature = 'totalSupply()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.totalSupply;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('totalSupply()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -219,11 +179,12 @@ export class WETH9Contract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'totalSupply'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transferFrom = {
|
||||
@@ -234,19 +195,7 @@ export class WETH9Contract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[src,
|
||||
dst,
|
||||
wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [src,
|
||||
dst,
|
||||
wad
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [src,
|
||||
dst,
|
||||
wad
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([src,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [src,
|
||||
dst,
|
||||
wad
|
||||
]);
|
||||
@@ -274,15 +223,7 @@ export class WETH9Contract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[src,
|
||||
dst,
|
||||
wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [src,
|
||||
dst,
|
||||
wad
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([src,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [src,
|
||||
dst,
|
||||
wad
|
||||
]);
|
||||
@@ -303,15 +244,7 @@ export class WETH9Contract extends BaseContract {
|
||||
wad: BigNumber,
|
||||
): string {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[src,
|
||||
dst,
|
||||
wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [src,
|
||||
dst,
|
||||
wad
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([src,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [src,
|
||||
dst,
|
||||
wad
|
||||
]);
|
||||
@@ -326,21 +259,7 @@ export class WETH9Contract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const functionSignature = 'transferFrom(address,address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[src,
|
||||
dst,
|
||||
wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [src,
|
||||
dst,
|
||||
wad
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [src,
|
||||
dst,
|
||||
wad
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferFrom;
|
||||
const encodedData = ethersFunction.encode([src,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [src,
|
||||
dst,
|
||||
wad
|
||||
]);
|
||||
@@ -354,11 +273,12 @@ export class WETH9Contract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transferFrom'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public withdraw = {
|
||||
@@ -367,13 +287,7 @@ export class WETH9Contract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('withdraw(uint256)').inputs;
|
||||
[wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [wad
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [wad
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('withdraw(uint256)').functions.withdraw.encode([wad
|
||||
const encodedData = self._strictEncodeArguments('withdraw(uint256)', [wad
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -395,11 +309,7 @@ export class WETH9Contract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('withdraw(uint256)').inputs;
|
||||
[wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [wad
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('withdraw(uint256)').functions.withdraw.encode([wad
|
||||
const encodedData = self._strictEncodeArguments('withdraw(uint256)', [wad
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -416,11 +326,7 @@ export class WETH9Contract extends BaseContract {
|
||||
wad: BigNumber,
|
||||
): string {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('withdraw(uint256)').inputs;
|
||||
[wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [wad
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('withdraw(uint256)').functions.withdraw.encode([wad
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('withdraw(uint256)', [wad
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@@ -431,15 +337,7 @@ export class WETH9Contract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const functionSignature = 'withdraw(uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [wad
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [wad
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.withdraw;
|
||||
const encodedData = ethersFunction.encode([wad
|
||||
const encodedData = self._strictEncodeArguments('withdraw(uint256)', [wad
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -451,11 +349,12 @@ export class WETH9Contract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'withdraw'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('withdraw(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public decimals = {
|
||||
@@ -465,12 +364,7 @@ export class WETH9Contract extends BaseContract {
|
||||
): Promise<number
|
||||
> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const functionSignature = 'decimals()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.decimals;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('decimals()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -481,11 +375,12 @@ export class WETH9Contract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'decimals'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('decimals()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<number
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public balanceOf = {
|
||||
@@ -496,15 +391,7 @@ export class WETH9Contract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const functionSignature = 'balanceOf(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[index_0
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [index_0
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.balanceOf;
|
||||
const encodedData = ethersFunction.encode([index_0
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [index_0
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -516,11 +403,12 @@ export class WETH9Contract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'balanceOf'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public symbol = {
|
||||
@@ -530,12 +418,7 @@ export class WETH9Contract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const functionSignature = 'symbol()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.symbol;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('symbol()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -546,11 +429,12 @@ export class WETH9Contract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'symbol'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('symbol()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transfer = {
|
||||
@@ -560,16 +444,7 @@ export class WETH9Contract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
|
||||
[dst,
|
||||
wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [dst,
|
||||
wad
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [dst,
|
||||
wad
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([dst,
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [dst,
|
||||
wad
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -594,13 +469,7 @@ export class WETH9Contract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
|
||||
[dst,
|
||||
wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [dst,
|
||||
wad
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([dst,
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [dst,
|
||||
wad
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -619,13 +488,7 @@ export class WETH9Contract extends BaseContract {
|
||||
wad: BigNumber,
|
||||
): string {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
|
||||
[dst,
|
||||
wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [dst,
|
||||
wad
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([dst,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [dst,
|
||||
wad
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -638,18 +501,7 @@ export class WETH9Contract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const functionSignature = 'transfer(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[dst,
|
||||
wad
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [dst,
|
||||
wad
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [dst,
|
||||
wad
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transfer;
|
||||
const encodedData = ethersFunction.encode([dst,
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [dst,
|
||||
wad
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -662,11 +514,12 @@ export class WETH9Contract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transfer'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public deposit = {
|
||||
@@ -674,10 +527,7 @@ export class WETH9Contract extends BaseContract {
|
||||
txData: Partial<TxDataPayable> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('deposit()').inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const encodedData = self._lookupEthersInterface('deposit()').functions.deposit.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('deposit()', []);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -696,9 +546,7 @@ export class WETH9Contract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('deposit()').inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('deposit()').functions.deposit.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('deposit()', []);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -713,9 +561,7 @@ export class WETH9Contract extends BaseContract {
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as WETH9Contract;
|
||||
const inputAbi = self._lookupAbi('deposit()').inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('deposit()').functions.deposit.encode([]);
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('deposit()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
async callAsync(
|
||||
@@ -724,12 +570,7 @@ export class WETH9Contract extends BaseContract {
|
||||
): Promise<void
|
||||
> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const functionSignature = 'deposit()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.deposit;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('deposit()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -740,11 +581,12 @@ export class WETH9Contract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'deposit'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray;
|
||||
const abiEncoder = self._lookupAbiEncoder('deposit()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public allowance = {
|
||||
@@ -756,18 +598,7 @@ export class WETH9Contract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as WETH9Contract;
|
||||
const functionSignature = 'allowance(address,address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[index_0,
|
||||
index_1
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [index_0,
|
||||
index_1
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0,
|
||||
index_1
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.allowance;
|
||||
const encodedData = ethersFunction.encode([index_0,
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [index_0,
|
||||
index_1
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -780,11 +611,12 @@ export class WETH9Contract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'allowance'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -830,7 +662,7 @@ export class WETH9Contract extends BaseContract {
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('WETH9', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -43,12 +43,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const functionSignature = 'name()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.name;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('name()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -59,11 +54,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'name'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('name()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public approve = {
|
||||
@@ -73,16 +69,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_spender,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_spender,
|
||||
_value
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -107,13 +94,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_spender,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -132,13 +113,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
|
||||
[_spender,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -151,18 +126,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const functionSignature = 'approve(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_spender,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_spender,
|
||||
_value
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.approve;
|
||||
const encodedData = ethersFunction.encode([_spender,
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -175,11 +139,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'approve'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public totalSupply = {
|
||||
@@ -189,12 +154,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const functionSignature = 'totalSupply()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.totalSupply;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('totalSupply()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -205,11 +165,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'totalSupply'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transferFrom = {
|
||||
@@ -220,19 +181,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
@@ -260,15 +209,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
@@ -289,15 +230,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
@@ -312,21 +245,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const functionSignature = 'transferFrom(address,address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_from,
|
||||
_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferFrom;
|
||||
const encodedData = ethersFunction.encode([_from,
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
_to,
|
||||
_value
|
||||
]);
|
||||
@@ -340,11 +259,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transferFrom'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public decimals = {
|
||||
@@ -354,12 +274,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): Promise<number
|
||||
> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const functionSignature = 'decimals()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.decimals;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('decimals()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -370,11 +285,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'decimals'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('decimals()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<number
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public balanceOf = {
|
||||
@@ -385,15 +301,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const functionSignature = 'balanceOf(address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_owner
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.balanceOf;
|
||||
const encodedData = ethersFunction.encode([_owner
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@@ -405,11 +313,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'balanceOf'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public symbol = {
|
||||
@@ -419,12 +328,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): Promise<string
|
||||
> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const functionSignature = 'symbol()';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, []);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.symbol;
|
||||
const encodedData = ethersFunction.encode([]);
|
||||
const encodedData = self._strictEncodeArguments('symbol()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@@ -435,11 +339,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'symbol'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('symbol()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public transfer = {
|
||||
@@ -449,16 +354,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<string> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
|
||||
[_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
|
||||
_value
|
||||
]);
|
||||
const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -483,13 +379,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
txData: Partial<TxData> = {},
|
||||
): Promise<number> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
|
||||
[_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -508,13 +398,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
|
||||
[_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString);
|
||||
const abiEncodedTransactionData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
@@ -527,18 +411,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): Promise<boolean
|
||||
> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const functionSignature = 'transfer(address,uint256)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_to,
|
||||
_value
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_to,
|
||||
_value
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
|
||||
_value
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transfer;
|
||||
const encodedData = ethersFunction.encode([_to,
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -551,11 +424,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'transfer'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public allowance = {
|
||||
@@ -567,18 +441,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const functionSignature = 'allowance(address,address)';
|
||||
const inputAbi = self._lookupAbi(functionSignature).inputs;
|
||||
[_owner,
|
||||
_spender
|
||||
] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
|
||||
_spender
|
||||
], BaseContract._bigNumberToString.bind(self));
|
||||
BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
|
||||
_spender
|
||||
]);
|
||||
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.allowance;
|
||||
const encodedData = ethersFunction.encode([_owner,
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner,
|
||||
_spender
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
@@ -591,11 +454,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
let resultArray = ethersFunction.decode(rawCallResult);
|
||||
const outputAbi = (_.find(self.abi, {name: 'allowance'}) as MethodAbi).outputs;
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
|
||||
resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
|
||||
return resultArray[0];
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -641,7 +505,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
super('ZRXToken', abi, address, provider, txDefaults);
|
||||
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
// tslint:enable:no-unbound-method
|
||||
|
@@ -10,6 +10,7 @@ export * from './generated-wrappers/exchange';
|
||||
export * from './generated-wrappers/forwarder';
|
||||
export * from './generated-wrappers/i_validator';
|
||||
export * from './generated-wrappers/i_wallet';
|
||||
export * from './generated-wrappers/multi_asset_proxy';
|
||||
export * from './generated-wrappers/order_validator';
|
||||
export * from './generated-wrappers/weth9';
|
||||
export * from './generated-wrappers/zrx_token';
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "1.0.22",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "1.0.21",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547040760,
|
||||
"version": "1.0.20",
|
||||
@@ -312,13 +330,11 @@
|
||||
"version": "0.2.4",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Add a `backend` parameter that allows you to specify the Ethereum library you use in your templates (`web3` or `ethers`). Ethers auto-converts small ints to numbers whereas Web3 doesn't. Defaults to `web3`",
|
||||
"note": "Add a `backend` parameter that allows you to specify the Ethereum library you use in your templates (`web3` or `ethers`). Ethers auto-converts small ints to numbers whereas Web3 doesn't. Defaults to `web3`",
|
||||
"pr": 413
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Add support for [tuple types](https://solidity.readthedocs.io/en/develop/abi-spec.html#handling-tuple-types)",
|
||||
"note": "Add support for [tuple types](https://solidity.readthedocs.io/en/develop/abi-spec.html#handling-tuple-types)",
|
||||
"pr": 413
|
||||
},
|
||||
{
|
||||
@@ -346,8 +362,7 @@
|
||||
"pr": 346
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Added CLI option to specify networkId, adding support for the JSON artifact format found in @0xproject/contracts",
|
||||
"note": "Added CLI option to specify networkId, adding support for the JSON artifact format found in @0xproject/contracts",
|
||||
"pr": 388
|
||||
}
|
||||
],
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.22 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.21 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.20 - _January 9, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen",
|
||||
"version": "1.0.20",
|
||||
"version": "1.0.22",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -31,10 +31,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md",
|
||||
"dependencies": {
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"chalk": "^2.3.0",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"glob": "^7.1.2",
|
||||
"handlebars": "^4.0.11",
|
||||
"lodash": "^4.17.5",
|
||||
@@ -45,7 +45,7 @@
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@types/glob": "5.0.35",
|
||||
"@types/handlebars": "^4.0.36",
|
||||
"@types/mkdirp": "^0.5.1",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { abiUtils, logUtils } from '@0x/utils';
|
||||
import { AbiEncoder, abiUtils, logUtils } from '@0x/utils';
|
||||
import chalk from 'chalk';
|
||||
import { AbiDefinition, ConstructorAbi, EventAbi, MethodAbi } from 'ethereum-types';
|
||||
import { sync as globSync } from 'glob';
|
||||
@@ -133,7 +133,7 @@ for (const abiFileName of abiFileNames) {
|
||||
singleReturnValue: methodAbi.outputs.length === 1,
|
||||
hasReturnValue: methodAbi.outputs.length !== 0,
|
||||
tsName: sanitizedMethodAbis[methodAbiIndex].name,
|
||||
functionSignature: abiUtils.getFunctionSignature(methodAbi),
|
||||
functionSignature: new AbiEncoder.Method(methodAbi).getSignature(),
|
||||
};
|
||||
return methodData;
|
||||
});
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "1.0.23",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547225310,
|
||||
"version": "1.0.22",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1547040760,
|
||||
"version": "1.0.21",
|
||||
@@ -193,8 +211,7 @@
|
||||
"version": "1.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Fix bug in string enum assertion. We erroneously were checking against the enum keys, not values",
|
||||
"note": "Fix bug in string enum assertion. We erroneously were checking against the enum keys, not values",
|
||||
"pr": 821
|
||||
}
|
||||
]
|
||||
@@ -339,8 +356,7 @@
|
||||
"note": "Re-publish Assert previously published under NPM package @0xproject/0x-assert"
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Added assertion isValidBaseUnitAmount which checks both that the value is a valid bigNumber and that it does not contain decimals."
|
||||
"note": "Added assertion isValidBaseUnitAmount which checks both that the value is a valid bigNumber and that it does not contain decimals."
|
||||
}
|
||||
],
|
||||
"timestamp": 1510585200
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.23 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.22 - _January 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.21 - _January 9, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/assert",
|
||||
"version": "1.0.21",
|
||||
"version": "1.0.23",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -29,7 +29,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/assert/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
"@types/valid-url": "^1.0.2",
|
||||
@@ -44,9 +44,9 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/json-schemas": "^2.1.5",
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/json-schemas": "^2.1.7",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"lodash": "^4.17.5",
|
||||
"valid-url": "^1.0.9"
|
||||
},
|
||||
|
@@ -1,4 +1,23 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "4.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Raise custom InsufficientAssetLiquidityError error with amountAvailableToFill attribute",
|
||||
"pr": 1437
|
||||
}
|
||||
],
|
||||
"timestamp": 1547225310
|
||||
},
|
||||
{
|
||||
"timestamp": 1547040760,
|
||||
"version": "3.0.5",
|
||||
@@ -81,8 +100,7 @@
|
||||
"pr": 1187
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"the `OrderProvider` now requires a new method `getAvailableMakerAssetDatasAsync` and the `StandardRelayerAPIOrderProvider` requires the network id at init.",
|
||||
"note": "the `OrderProvider` now requires a new method `getAvailableMakerAssetDatasAsync` and the `StandardRelayerAPIOrderProvider` requires the network id at init.",
|
||||
"pr": 1203
|
||||
},
|
||||
{
|
||||
@@ -90,13 +108,11 @@
|
||||
"pr": 1197
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Fix bug where `BuyQuoteInfo` objects could return `totalEthAmount` and `feeEthAmount` that were not whole numbers",
|
||||
"note": "Fix bug where `BuyQuoteInfo` objects could return `totalEthAmount` and `feeEthAmount` that were not whole numbers",
|
||||
"pr": 1207
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Fix bug where default values for `AssetBuyer` public facing methods could get overriden by `undefined` values",
|
||||
"note": "Fix bug where default values for `AssetBuyer` public facing methods could get overriden by `undefined` values",
|
||||
"pr": 1207
|
||||
},
|
||||
{
|
||||
@@ -117,8 +133,7 @@
|
||||
"pr": 1131
|
||||
},
|
||||
{
|
||||
"note":
|
||||
"Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers",
|
||||
"note": "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers",
|
||||
"pr": 1105
|
||||
},
|
||||
{
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.0.1 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.0 - _January 11, 2019_
|
||||
|
||||
* Raise custom InsufficientAssetLiquidityError error with amountAvailableToFill attribute (#1437)
|
||||
|
||||
## v3.0.5 - _January 9, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/asset-buyer",
|
||||
"version": "3.0.5",
|
||||
"version": "4.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -36,21 +36,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/asset-buyer/README.md",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^1.0.21",
|
||||
"@0x/connect": "^3.0.11",
|
||||
"@0x/contract-wrappers": "^4.2.0",
|
||||
"@0x/json-schemas": "^2.1.5",
|
||||
"@0x/order-utils": "^3.1.0",
|
||||
"@0x/subproviders": "^2.1.9",
|
||||
"@0x/types": "^1.5.0",
|
||||
"@0x/typescript-typings": "^3.0.6",
|
||||
"@0x/utils": "^2.1.1",
|
||||
"@0x/web3-wrapper": "^3.2.2",
|
||||
"ethereum-types": "^1.1.4",
|
||||
"@0x/assert": "^1.0.23",
|
||||
"@0x/connect": "^3.0.13",
|
||||
"@0x/contract-wrappers": "^5.0.0",
|
||||
"@0x/json-schemas": "^2.1.7",
|
||||
"@0x/order-utils": "^3.1.2",
|
||||
"@0x/subproviders": "^2.1.11",
|
||||
"@0x/types": "^1.5.2",
|
||||
"@0x/typescript-typings": "^3.0.8",
|
||||
"@0x/utils": "^3.0.1",
|
||||
"@0x/web3-wrapper": "^3.2.4",
|
||||
"ethereum-types": "^1.1.6",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/tslint-config": "^2.0.0",
|
||||
"@0x/tslint-config": "^2.0.2",
|
||||
"@types/lodash": "^4.14.116",
|
||||
"@types/mocha": "^2.2.42",
|
||||
"@types/node": "*",
|
||||
|
22
packages/asset-buyer/src/errors.ts
Normal file
22
packages/asset-buyer/src/errors.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { BigNumber } from '@0x/utils';
|
||||
|
||||
import { AssetBuyerError } from './types';
|
||||
|
||||
/**
|
||||
* Error class representing insufficient asset liquidity
|
||||
*/
|
||||
export class InsufficientAssetLiquidityError extends Error {
|
||||
/**
|
||||
* The amount availabe to fill (in base units) factoring in slippage.
|
||||
*/
|
||||
public amountAvailableToFill: BigNumber;
|
||||
/**
|
||||
* @param amountAvailableToFill The amount availabe to fill (in base units) factoring in slippage
|
||||
*/
|
||||
constructor(amountAvailableToFill: BigNumber) {
|
||||
super(AssetBuyerError.InsufficientAssetLiquidity);
|
||||
this.amountAvailableToFill = amountAvailableToFill;
|
||||
// Setting prototype so instanceof works. See https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
||||
Object.setPrototypeOf(this, InsufficientAssetLiquidityError.prototype);
|
||||
}
|
||||
}
|
@@ -9,6 +9,7 @@ export { SignedOrder } from '@0x/types';
|
||||
export { BigNumber } from '@0x/utils';
|
||||
|
||||
export { AssetBuyer } from './asset_buyer';
|
||||
export { InsufficientAssetLiquidityError } from './errors';
|
||||
export { BasicOrderProvider } from './order_providers/basic_order_provider';
|
||||
export { StandardRelayerAPIOrderProvider } from './order_providers/standard_relayer_api_order_provider';
|
||||
export {
|
||||
|
@@ -102,7 +102,7 @@ export interface AssetBuyerOpts {
|
||||
}
|
||||
|
||||
/**
|
||||
* Possible errors thrown by an AssetBuyer instance or associated static methods.
|
||||
* Possible error messages thrown by an AssetBuyer instance or associated static methods.
|
||||
*/
|
||||
export enum AssetBuyerError {
|
||||
NoEtherTokenContractFound = 'NO_ETHER_TOKEN_CONTRACT_FOUND',
|
||||
|
@@ -3,6 +3,7 @@ import { BigNumber } from '@0x/utils';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { constants } from '../constants';
|
||||
import { InsufficientAssetLiquidityError } from '../errors';
|
||||
import { AssetBuyerError, BuyQuote, BuyQuoteInfo, OrdersAndFillableAmounts } from '../types';
|
||||
|
||||
import { orderUtils } from './order_utils';
|
||||
@@ -33,7 +34,18 @@ export const buyQuoteCalculator = {
|
||||
});
|
||||
// if we do not have enough orders to cover the desired assetBuyAmount, throw
|
||||
if (remainingFillAmount.gt(constants.ZERO_AMOUNT)) {
|
||||
throw new Error(AssetBuyerError.InsufficientAssetLiquidity);
|
||||
// We needed the amount they requested to buy, plus the amount for slippage
|
||||
const totalAmountRequested = assetBuyAmount.plus(slippageBufferAmount);
|
||||
const amountAbleToFill = totalAmountRequested.minus(remainingFillAmount);
|
||||
// multiplierNeededWithSlippage represents what we need to multiply the assetBuyAmount by
|
||||
// in order to get the total amount needed considering slippage
|
||||
// i.e. if slippagePercent was 0.2 (20%), multiplierNeededWithSlippage would be 1.2
|
||||
const multiplierNeededWithSlippage = new BigNumber(1).plus(slippagePercentage);
|
||||
// Given amountAvailableToFillConsideringSlippage * multiplierNeededWithSlippage = amountAbleToFill
|
||||
// We divide amountUnableToFill by multiplierNeededWithSlippage to determine amountAvailableToFillConsideringSlippage
|
||||
const amountAvailableToFillConsideringSlippage = amountAbleToFill.div(multiplierNeededWithSlippage).floor();
|
||||
|
||||
throw new InsufficientAssetLiquidityError(amountAvailableToFillConsideringSlippage);
|
||||
}
|
||||
// if we are not buying ZRX:
|
||||
// given the orders calculated above, find the fee-orders that cover the desired assetBuyAmount (with slippage)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user