Compare commits
329 Commits
@0xproject
...
@0xproject
Author | SHA1 | Date | |
---|---|---|---|
|
634032d5be | ||
|
602abc53dd | ||
|
fdbaa9768a | ||
|
293d7261e0 | ||
|
efb6eb28ce | ||
|
ac5531ce85 | ||
|
bc2415c70e | ||
|
0fd411f83f | ||
|
b74ad0ad12 | ||
|
4c58836735 | ||
|
3206b80dbd | ||
|
4910f7a61e | ||
|
6e9109eaec | ||
|
a04ec14cf0 | ||
|
7d3df3c117 | ||
|
b3a03f8e3e | ||
|
e5668c1e5c | ||
|
92e74bc4fa | ||
|
7e12269baf | ||
|
f3f264f5fd | ||
|
2e3c9b87df | ||
|
0a113e1cf7 | ||
|
fd772c48cf | ||
|
1c7dce6054 | ||
|
0a2947b860 | ||
|
c80877af43 | ||
|
e68b9c7e81 | ||
|
19198737a5 | ||
|
fea4b6aecd | ||
|
20e2673b82 | ||
|
ef1375b9dd | ||
|
58f1939ec1 | ||
|
936f6ac10f | ||
|
7e04c4f24b | ||
|
9495c8f46c | ||
|
b3f91600d3 | ||
|
ddf4437fb6 | ||
|
4153d57849 | ||
|
0652790703 | ||
|
9c934d903d | ||
|
d7a7e28925 | ||
|
6dec29e214 | ||
|
43cf8d30bd | ||
|
254d3f53e2 | ||
|
ec198343b5 | ||
|
876517d458 | ||
|
1233c33116 | ||
|
eebf205817 | ||
|
e666bb44c6 | ||
|
39cb0b5122 | ||
|
58003a2811 | ||
|
7f2a7cfa77 | ||
|
8fba0477a6 | ||
|
7ca1ba7e1e | ||
|
e6f2c7a382 | ||
|
69f5f5e946 | ||
|
68a8acbe7b | ||
|
852811b314 | ||
|
2404ff0304 | ||
|
9ff4cacf0f | ||
|
e443cb2a3b | ||
|
f3c6cce455 | ||
|
ae14b0a71d | ||
|
3c7ebe2697 | ||
|
10fb6061cc | ||
|
223df8006a | ||
|
1c9428cbba | ||
|
18dc5d17b5 | ||
|
4d50933189 | ||
|
9b3680780f | ||
|
a26e77074f | ||
|
568e4d33f2 | ||
|
fd004032cb | ||
|
4b6324050d | ||
|
12d62e1157 | ||
|
063c6b66b6 | ||
|
d9b1d31e73 | ||
|
0bad911a16 | ||
|
518efa8ad2 | ||
|
6e87c9e713 | ||
|
b61852b1f5 | ||
|
fcbe24a126 | ||
|
55312d00ef | ||
|
a96e3f3222 | ||
|
e35519b50f | ||
|
ae775f9664 | ||
|
071b1c47d1 | ||
|
4cc5bbaf19 | ||
|
a264c36a48 | ||
|
0c2ab22656 | ||
|
47adad5122 | ||
|
745f209f7e | ||
|
2287597712 | ||
|
eea8b15180 | ||
|
600a2b40af | ||
|
a7c51593e4 | ||
|
218876ac19 | ||
|
6cda67df10 | ||
|
897515c002 | ||
|
9deaf612f1 | ||
|
b7676d8c46 | ||
|
05aa2fa421 | ||
|
03f5c9b950 | ||
|
4c9c4c487a | ||
|
c172b9e080 | ||
|
5533a84dcd | ||
|
562bcb8571 | ||
|
00c07b38a4 | ||
|
f44bfa9682 | ||
|
7357a0a324 | ||
|
36a49966eb | ||
|
f818d06b43 | ||
|
548246c05f | ||
|
2bf1aa975a | ||
|
4be8eca3fe | ||
|
e17ace397c | ||
|
6bdabe72b9 | ||
|
00bfc7f889 | ||
|
5fcb77e591 | ||
|
df8de7ff51 | ||
|
67d7540907 | ||
|
83d0bad3a1 | ||
|
9d80a62bb1 | ||
|
629653425d | ||
|
03ce1d8641 | ||
|
225baeb5cb | ||
|
cf171d28c7 | ||
|
61434a9121 | ||
|
20590b7d35 | ||
|
fce7081215 | ||
|
83c7c8110d | ||
|
c4680a97a8 | ||
|
91a5bcf380 | ||
|
7e9ae458e2 | ||
|
4e284f5e6c | ||
|
75ded89790 | ||
|
598ce0d401 | ||
|
fc3058c1e2 | ||
|
d14ae70776 | ||
|
882816d609 | ||
|
2205e2b9a0 | ||
|
855fdd7921 | ||
|
99b1f81e89 | ||
|
46ad7b1b38 | ||
|
7e5b7a7f2a | ||
|
156e85a6b3 | ||
|
6fce02d25e | ||
|
4ddb86df53 | ||
|
3565e96f42 | ||
|
2c7db23022 | ||
|
fe51c9a9a2 | ||
|
5324dfa5a7 | ||
|
881d32e733 | ||
|
1f4cbb7479 | ||
|
b17bbdaa7d | ||
|
5458a1c1b7 | ||
|
fa98450754 | ||
|
7b4f2b47de | ||
|
400a97e7a8 | ||
|
a816fb5958 | ||
|
c7ad6ebad6 | ||
|
85b4a82a4b | ||
|
f18fa8e947 | ||
|
44cd185c66 | ||
|
890f414b5a | ||
|
03b1b12ef1 | ||
|
dae6f28f8a | ||
|
5aca3a2d7d | ||
|
7f257e258f | ||
|
6a9d3de0f9 | ||
|
05aae36813 | ||
|
d5d6079b67 | ||
|
bb4c8bf8eb | ||
|
3eb40db498 | ||
|
576f63d5e4 | ||
|
cda1dc82e9 | ||
|
2721252d6a | ||
|
45ac960308 | ||
|
47d74aa24a | ||
|
48aa1ad57d | ||
|
2eccb28dee | ||
|
9c3bfd920f | ||
|
76eb1e9e7f | ||
|
b7af597668 | ||
|
d635559a30 | ||
|
58dd90b7b7 | ||
|
ead990a734 | ||
|
27400fcd5b | ||
|
d4631e14b2 | ||
|
8df2cc103e | ||
|
8e0e9c7d3a | ||
|
913930b561 | ||
|
994c8db1f3 | ||
|
0c6cbb66b1 | ||
|
f09393d4f4 | ||
|
f6d963d45a | ||
|
39e3733be4 | ||
|
09659cc304 | ||
|
6811bdec40 | ||
|
6577d60733 | ||
|
c7db837214 | ||
|
03cb7233dc | ||
|
6682abf89d | ||
|
78fbf0f7ba | ||
|
89547332ee | ||
|
75539bf675 | ||
|
eaeb715e56 | ||
|
ca55cc99ed | ||
|
7cc4a8f5ce | ||
|
fa35768fc9 | ||
|
4d0ff0dce4 | ||
|
8aac6e46d4 | ||
|
1feac1a308 | ||
|
d3e42e4b3e | ||
|
3a1ca32ff1 | ||
|
ecf86d1d13 | ||
|
adc6170f02 | ||
|
02600f40d2 | ||
|
16ea0348a9 | ||
|
44162811bd | ||
|
57acb8db5c | ||
|
2bcb7d5639 | ||
|
a99e54330a | ||
|
e219772b2a | ||
|
144a507a2e | ||
|
5019c51940 | ||
|
da1071526f | ||
|
7ad314472d | ||
|
4f6168a982 | ||
|
218a872968 | ||
|
0043c5e1ac | ||
|
d0e7046a89 | ||
|
52ad16b920 | ||
|
5a4c0bff6a | ||
|
6205209fbb | ||
|
6ebf8a57d1 | ||
|
c02dfc4fb1 | ||
|
9d62e5fb6f | ||
|
6f13d107c4 | ||
|
e56b2ceebb | ||
|
7de244ed62 | ||
|
1e9147b8bb | ||
|
2f65fadeaa | ||
|
a17091b394 | ||
|
ed77c6cb54 | ||
|
bc37cc8a91 | ||
|
387363283c | ||
|
709026bf1a | ||
|
f2b2b86786 | ||
|
d0fbea76d8 | ||
|
8269610a5c | ||
|
20c88a46d9 | ||
|
661029f7cc | ||
|
850d32d60c | ||
|
eb881b9729 | ||
|
091ba473ff | ||
|
fca051c565 | ||
|
6463cda204 | ||
|
d004df56e3 | ||
|
359dd482c4 | ||
|
89e98240b4 | ||
|
1c1f2ef1ff | ||
|
4fa774f866 | ||
|
4671999ea0 | ||
|
0a73bbe279 | ||
|
8d30058a6d | ||
|
69151c06e4 | ||
|
2e3c02887e | ||
|
7603cef308 | ||
|
be370c4e19 | ||
|
c6dece6bd1 | ||
|
93a5b3f457 | ||
|
4242176d29 | ||
|
1cadbeed88 | ||
|
86cc011212 | ||
|
c0facfc28f | ||
|
ad52a82190 | ||
|
60b6ed514f | ||
|
ef32822b31 | ||
|
bb0cedd2de | ||
|
8175c7c085 | ||
|
5c2d725721 | ||
|
72571628da | ||
|
fa6130c907 | ||
|
8ccdd54974 | ||
|
6c1409b00d | ||
|
542a1a11b9 | ||
|
63ffa80c5c | ||
|
609342be7a | ||
|
52394884da | ||
|
af08177f79 | ||
|
45fdfc2d3d | ||
|
d18554e0e8 | ||
|
3c3f9ca85b | ||
|
005a02efeb | ||
|
6206ebc994 | ||
|
dd9f5adc2e | ||
|
748d805a32 | ||
|
4b59bf01b3 | ||
|
b4faa4851a | ||
|
f37fcc147c | ||
|
dc5694e544 | ||
|
e588f6f8c3 | ||
|
d227f2ad7c | ||
|
97c228031a | ||
|
ad85011d62 | ||
|
a70379625d | ||
|
7350333129 | ||
|
216420fdc5 | ||
|
c559fbbe8c | ||
|
71d68f975c | ||
|
390534497e | ||
|
3f0ec89f11 | ||
|
d3aa4f2bc7 | ||
|
f58f0ddb67 | ||
|
b08bd0f9ab | ||
|
3998b47d84 | ||
|
d965fdb11d | ||
|
ddb64b3ec1 | ||
|
5055ec8617 | ||
|
ec3d8a034f | ||
|
c452294bcc | ||
|
d5757499bc | ||
|
139c8c2e78 | ||
|
215e33fa6c | ||
|
3d12b84f1d | ||
|
d8adc88c52 | ||
|
5119e49e47 | ||
|
cfb9f87418 |
12
.editorconfig
Normal file
12
.editorconfig
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# EditorConfig http://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# All files
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.sol linguist-language=Solidity
|
@@ -1,6 +0,0 @@
|
|||||||
.*
|
|
||||||
tsconfig.json
|
|
||||||
tslint.json
|
|
||||||
webpack.config.js
|
|
||||||
yarn.lock
|
|
||||||
docs
|
|
@@ -2,3 +2,4 @@ lib
|
|||||||
generated
|
generated
|
||||||
.nyc_output
|
.nyc_output
|
||||||
/packages/contracts/build/contracts
|
/packages/contracts/build/contracts
|
||||||
|
package.json
|
||||||
|
1
CODEOWNERS
Normal file
1
CODEOWNERS
Normal file
@@ -0,0 +1 @@
|
|||||||
|
* @abandeali1 @BMillman19 @dekz @fabioberger @LogvinovLeon @Recmo
|
62
ISSUE_TEMPLATE.md
Normal file
62
ISSUE_TEMPLATE.md
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<!--- Thank you for taking the time to file an Issue -->
|
||||||
|
|
||||||
|
<!--- Before submitting please check to see if this issue was already reported -->
|
||||||
|
|
||||||
|
<!--- Provide a general summary of the issue in the Title above -->
|
||||||
|
|
||||||
|
## Expected Behavior
|
||||||
|
|
||||||
|
<!--- If you're describing a bug, tell us what should happen -->
|
||||||
|
|
||||||
|
<!--- If you're suggesting a package change/improvement, tell us how it should work -->
|
||||||
|
|
||||||
|
<!--- If you're suggesting a contract or protocol change/improvement, visit our ZEIPs repo -->
|
||||||
|
|
||||||
|
## Current Behavior
|
||||||
|
|
||||||
|
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
||||||
|
|
||||||
|
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
||||||
|
|
||||||
|
## Possible Solution
|
||||||
|
|
||||||
|
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||||
|
|
||||||
|
<!--- or ideas how to implement the addition or change -->
|
||||||
|
|
||||||
|
## Steps to Reproduce (for bugs)
|
||||||
|
|
||||||
|
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
|
||||||
|
|
||||||
|
<!--- reproduce this bug. Include code to reproduce, if relevant -->
|
||||||
|
|
||||||
|
```
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
||||||
|
|
||||||
|
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
||||||
|
|
||||||
|
## Your Environment
|
||||||
|
|
||||||
|
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||||
|
|
||||||
|
| Package | Version |
|
||||||
|
| ------------------: | :------ |
|
||||||
|
| `0x.js` | 0.25.0 |
|
||||||
|
| `Exchange Contract` | v1 |
|
||||||
|
|
||||||
|
| Network |
|
||||||
|
| ------- |
|
||||||
|
| NAME |
|
||||||
|
|
||||||
|
<!-- For example:
|
||||||
|
| mainnet |
|
||||||
|
| kovan |
|
||||||
|
| testrpc |
|
||||||
|
-->
|
@@ -1,3 +1,42 @@
|
|||||||
This PR:
|
<!--- Thank you for taking the time to submit a Pull Request -->
|
||||||
|
|
||||||
\*
|
<!--- Provide a general summary of the issue in the Title above -->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
<!--- Describe your changes in detail -->
|
||||||
|
|
||||||
|
## Motivation and Context
|
||||||
|
|
||||||
|
<!--- Why is this change required? What problem does it solve? -->
|
||||||
|
|
||||||
|
<!--- If it fixes an open issue, please link to the issue here. -->
|
||||||
|
|
||||||
|
## How Has This Been Tested?
|
||||||
|
|
||||||
|
<!--- Please describe in detail how you tested your changes. -->
|
||||||
|
|
||||||
|
<!--- Include details of your testing environment, and the tests you ran to -->
|
||||||
|
|
||||||
|
<!--- see how your change affects other areas of the code, etc. -->
|
||||||
|
|
||||||
|
## Types of changes
|
||||||
|
|
||||||
|
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
|
||||||
|
|
||||||
|
* [ ] Bug fix (non-breaking change which fixes an issue)
|
||||||
|
* [ ] New feature (non-breaking change which adds functionality)
|
||||||
|
* [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
||||||
|
|
||||||
|
## Checklist:
|
||||||
|
|
||||||
|
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
||||||
|
|
||||||
|
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
||||||
|
|
||||||
|
* [ ] Change requires a change to the documentation.
|
||||||
|
* [ ] Added tests to cover my changes.
|
||||||
|
* [ ] Added new entries to the relevant CHANGELOGs.
|
||||||
|
* [ ] Updated the new versions of the changed packages in the relevant CHANGELOGs.
|
||||||
|
* [ ] Labeled this PR with the 'WIP' label if it is a work in progress.
|
||||||
|
* [ ] Labeled this PR with the labels corresponding to the changed package.
|
||||||
|
@@ -40,8 +40,8 @@ This repository contains all the 0x developer tools written in TypeScript. Our h
|
|||||||
| Package | Description |
|
| Package | Description |
|
||||||
| ----------------------------------------------------------- | ---------------------------------------------------------------- |
|
| ----------------------------------------------------------- | ---------------------------------------------------------------- |
|
||||||
| [`@0xproject/contracts`](/packages/contracts) | 0x solidity smart contracts & tests |
|
| [`@0xproject/contracts`](/packages/contracts) | 0x solidity smart contracts & tests |
|
||||||
| [`@0xproject/kovan_faucets`](/packages/kovan-faucets) | A faucet micro-service that dispenses test ERC20 tokens or Ether |
|
|
||||||
| [`@0xproject/monorepo-scripts`](/packages/monorepo-scripts) | Shared monorepo scripts |
|
| [`@0xproject/monorepo-scripts`](/packages/monorepo-scripts) | Shared monorepo scripts |
|
||||||
|
| [`@0xproject/testnet-faucets`](/packages/testnet-faucets) | A faucet micro-service that dispenses test ERC20 tokens or Ether |
|
||||||
| [`@0xproject/website`](/packages/website) | 0x website & Portal DApp |
|
| [`@0xproject/website`](/packages/website) | 0x website & Portal DApp |
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -81,6 +81,12 @@ Build all packages
|
|||||||
yarn lerna:run build
|
yarn lerna:run build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Continuously rebuild on exchange
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn dev
|
||||||
|
```
|
||||||
|
|
||||||
### Lint
|
### Lint
|
||||||
|
|
||||||
Lint all packages
|
Lint all packages
|
||||||
|
@@ -2,6 +2,11 @@
|
|||||||
"lerna": "2.5.1",
|
"lerna": "2.5.1",
|
||||||
"packages": ["packages/*"],
|
"packages": ["packages/*"],
|
||||||
"version": "independent",
|
"version": "independent",
|
||||||
|
"commands": {
|
||||||
|
"publish": {
|
||||||
|
"ignore": ["test/**/*", "*.md", "scripts", "lib", "tslint.json", "tsconfig.json"]
|
||||||
|
}
|
||||||
|
},
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"useWorkspaces": true
|
"useWorkspaces": true
|
||||||
}
|
}
|
||||||
|
@@ -3,9 +3,10 @@
|
|||||||
"name": "0x.js",
|
"name": "0x.js",
|
||||||
"workspaces": ["packages/*"],
|
"workspaces": ["packages/*"],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"dev": "lerna run --parallel build:watch",
|
||||||
"testrpc": "testrpc -p 8545 --networkId 50 -m \"${npm_package_config_mnemonic}\"",
|
"testrpc": "testrpc -p 8545 --networkId 50 -m \"${npm_package_config_mnemonic}\"",
|
||||||
"prettier": "prettier --write '**/*.{ts,tsx,json,md}'",
|
"prettier": "prettier --write '**/*.{ts,tsx,json,md}' --config .prettierrc",
|
||||||
"prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}'",
|
"prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}' --config .prettierrc",
|
||||||
"lerna:run": "lerna run",
|
"lerna:run": "lerna run",
|
||||||
"lerna:rebuild": "lerna run clean; lerna run build;",
|
"lerna:rebuild": "lerna run clean; lerna run build;",
|
||||||
"lerna:publish":
|
"lerna:publish":
|
||||||
@@ -15,7 +16,7 @@
|
|||||||
"mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic"
|
"mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0xproject/utils": "^0.2.0",
|
"@0xproject/utils": "^0.3.1",
|
||||||
"async-child-process": "^1.1.1",
|
"async-child-process": "^1.1.1",
|
||||||
"ethereumjs-testrpc": "^6.0.3",
|
"ethereumjs-testrpc": "^6.0.3",
|
||||||
"lerna": "^2.5.1",
|
"lerna": "^2.5.1",
|
||||||
|
10
packages/0x.js/.npmignore
Normal file
10
packages/0x.js/.npmignore
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
.*
|
||||||
|
tsconfig.json
|
||||||
|
webpack.config.js
|
||||||
|
yarn-error.log
|
||||||
|
test/
|
||||||
|
/src/
|
||||||
|
/_bundles/
|
||||||
|
/contract_templates/
|
||||||
|
/generated_docs/
|
||||||
|
/scripts/
|
@@ -1,6 +1,36 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
## v0.30.1 - _January 18, 2018_
|
## v0.32.2 - _February 9, 2018_
|
||||||
|
|
||||||
|
* Fix publishing issue where .npmignore was not properly excluding undesired content (#389)
|
||||||
|
|
||||||
|
## v0.32.1 - _February 7, 2018_
|
||||||
|
|
||||||
|
* Reorganized `BlockParamLiteral` export into `@0xproject/types` package (#355)
|
||||||
|
* Now using `abi-gen` package to generate ContractEventArgs types (#371)
|
||||||
|
|
||||||
|
## v0.32.0 - _February 5, 2018_
|
||||||
|
|
||||||
|
* Add `zeroEx.etherToken.getContractAddressIfExists` (#350)
|
||||||
|
* Fixed the bug causing order watcher to throw if there is an event with the same signature but different indexed fields (#366)
|
||||||
|
|
||||||
|
## v0.31.1 - _February 1, 2018_
|
||||||
|
|
||||||
|
* Fix the bug causing order watcher to throw if makerToken === zrx (#357)
|
||||||
|
|
||||||
|
## v0.31.0 - _January 30, 2018_
|
||||||
|
|
||||||
|
* 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. (#349)
|
||||||
|
|
||||||
|
## v0.30.2 - _January 29, 2018_
|
||||||
|
|
||||||
|
* Add Rinkeby testnet addresses to artifacts (#337)
|
||||||
|
* Move @0xproject/types to dependencies from devDependencies fixing missing type errors
|
||||||
|
|
||||||
|
## v0.30.1 - _January 24, 2018_
|
||||||
|
|
||||||
* Fix a bug allowing negative fill values (#212)
|
* Fix a bug allowing negative fill values (#212)
|
||||||
* Fix a bug that made it impossible to pass a custom ZRX address (#341)
|
* Fix a bug that made it impossible to pass a custom ZRX address (#341)
|
||||||
|
44
packages/0x.js/contract_templates/contract.handlebars
Normal file
44
packages/0x.js/contract_templates/contract.handlebars
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/**
|
||||||
|
* This file is auto-generated using abi-gen. Don't edit directly.
|
||||||
|
* Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/0x.js/contract_templates.
|
||||||
|
*/
|
||||||
|
// tslint:disable:no-consecutive-blank-lines
|
||||||
|
// tslint:disable-next-line:no-unused-variable
|
||||||
|
import { TxData, TxDataPayable } from '@0xproject/types';
|
||||||
|
import { BigNumber, classUtils, promisify } from '@0xproject/utils';
|
||||||
|
import * as Web3 from 'web3';
|
||||||
|
|
||||||
|
import {BaseContract} from './base_contract';
|
||||||
|
|
||||||
|
{{#if events}}
|
||||||
|
export type {{contractName}}ContractEventArgs =
|
||||||
|
{{#each events}}
|
||||||
|
| {{name}}ContractEventArgs{{#if @last}};{{/if}}
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
export enum {{contractName}}Events {
|
||||||
|
{{#each events}}
|
||||||
|
{{name}} = '{{name}}',
|
||||||
|
{{/each}}
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#each events}}
|
||||||
|
{{> event}}
|
||||||
|
|
||||||
|
{{/each}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
export class {{contractName}}Contract extends BaseContract {
|
||||||
|
{{#each methods}}
|
||||||
|
{{#this.constant}}
|
||||||
|
{{> call contractName=../contractName}}
|
||||||
|
{{/this.constant}}
|
||||||
|
{{^this.constant}}
|
||||||
|
{{> tx contractName=../contractName}}
|
||||||
|
{{/this.constant}}
|
||||||
|
{{/each}}
|
||||||
|
constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) {
|
||||||
|
super(web3ContractInstance, defaults);
|
||||||
|
classUtils.bindAll(this, ['_web3ContractInstance', '_defaults']);
|
||||||
|
}
|
||||||
|
} // tslint:disable:max-file-line-count
|
@@ -5,8 +5,8 @@ public {{this.name}} = {
|
|||||||
): Promise<{{> return_type outputs=outputs}}> {
|
): Promise<{{> return_type outputs=outputs}}> {
|
||||||
const self = this as {{contractName}}Contract;
|
const self = this as {{contractName}}Contract;
|
||||||
const result = await promisify<{{> return_type outputs=outputs}}>(
|
const result = await promisify<{{> return_type outputs=outputs}}>(
|
||||||
self.web3ContractInstance.{{this.name}}.call,
|
self._web3ContractInstance.{{this.name}}.call,
|
||||||
self.web3ContractInstance,
|
self._web3ContractInstance,
|
||||||
)(
|
)(
|
||||||
{{> params inputs=inputs}}
|
{{> params inputs=inputs}}
|
||||||
);
|
);
|
@@ -0,0 +1,5 @@
|
|||||||
|
export interface {{name}}ContractEventArgs {
|
||||||
|
{{#each inputs}}
|
||||||
|
{{name}}: {{#returnType type}}{{/returnType}};
|
||||||
|
{{/each}}
|
||||||
|
}
|
@@ -9,7 +9,7 @@ public {{this.name}} = {
|
|||||||
{{/this.payable}}
|
{{/this.payable}}
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const self = this as {{contractName}}Contract;
|
const self = this as {{contractName}}Contract;
|
||||||
const txDataWithDefaults = await self.applyDefaultsToTxDataAsync(
|
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
|
||||||
txData,
|
txData,
|
||||||
self.{{this.name}}.estimateGasAsync.bind(
|
self.{{this.name}}.estimateGasAsync.bind(
|
||||||
self,
|
self,
|
||||||
@@ -17,7 +17,7 @@ public {{this.name}} = {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
const txHash = await promisify<string>(
|
const txHash = await promisify<string>(
|
||||||
self.web3ContractInstance.{{this.name}}, self.web3ContractInstance,
|
self._web3ContractInstance.{{this.name}}, self._web3ContractInstance,
|
||||||
)(
|
)(
|
||||||
{{> params inputs=inputs}}
|
{{> params inputs=inputs}}
|
||||||
txDataWithDefaults,
|
txDataWithDefaults,
|
||||||
@@ -29,11 +29,11 @@ public {{this.name}} = {
|
|||||||
txData: TxData = {},
|
txData: TxData = {},
|
||||||
): Promise<number> {
|
): Promise<number> {
|
||||||
const self = this as {{contractName}}Contract;
|
const self = this as {{contractName}}Contract;
|
||||||
const txDataWithDefaults = await self.applyDefaultsToTxDataAsync(
|
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
|
||||||
txData,
|
txData,
|
||||||
);
|
);
|
||||||
const gas = await promisify<number>(
|
const gas = await promisify<number>(
|
||||||
self.web3ContractInstance.{{this.name}}.estimateGas, self.web3ContractInstance,
|
self._web3ContractInstance.{{this.name}}.estimateGas, self._web3ContractInstance,
|
||||||
)(
|
)(
|
||||||
{{> params inputs=inputs}}
|
{{> params inputs=inputs}}
|
||||||
txDataWithDefaults,
|
txDataWithDefaults,
|
||||||
@@ -45,7 +45,7 @@ public {{this.name}} = {
|
|||||||
txData: TxData = {},
|
txData: TxData = {},
|
||||||
): string {
|
): string {
|
||||||
const self = this as {{contractName}}Contract;
|
const self = this as {{contractName}}Contract;
|
||||||
const abiEncodedTransactionData = self.web3ContractInstance.{{this.name}}.getData();
|
const abiEncodedTransactionData = self._web3ContractInstance.{{this.name}}.getData();
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
@@ -1,25 +1,29 @@
|
|||||||
{
|
{
|
||||||
"name": "0x.js",
|
"name": "0x.js",
|
||||||
"version": "0.30.0",
|
"version": "0.32.2",
|
||||||
"description": "A javascript library for interacting with the 0x protocol",
|
"description": "A javascript library for interacting with the 0x protocol",
|
||||||
"keywords": ["0x.js", "0xproject", "ethereum", "tokens", "exchange"],
|
"keywords": [
|
||||||
|
"0x.js",
|
||||||
|
"0xproject",
|
||||||
|
"ethereum",
|
||||||
|
"tokens",
|
||||||
|
"exchange"
|
||||||
|
],
|
||||||
"main": "lib/src/index.js",
|
"main": "lib/src/index.js",
|
||||||
"types": "lib/src/index.d.ts",
|
"types": "lib/src/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"build:watch": "tsc -w",
|
||||||
"prebuild": "run-s clean generate_contract_wrappers",
|
"prebuild": "run-s clean generate_contract_wrappers",
|
||||||
"build": "run-p build:umd:prod build:commonjs; exit 0;",
|
"build": "run-p build:umd:prod build:commonjs; exit 0;",
|
||||||
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
|
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
|
||||||
"upload_docs_json":
|
"upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json",
|
||||||
"aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json",
|
"generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template contract_templates/contract.handlebars --partials 'contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated",
|
||||||
"generate_contract_wrappers":
|
|
||||||
"node ../abi-gen/lib/index.js --abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --templates contract_templates --output src/contract_wrappers/generated",
|
|
||||||
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
|
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
|
||||||
"test:circleci": "run-s test:coverage report_test_coverage",
|
"test:circleci": "run-s test:coverage report_test_coverage",
|
||||||
"test": "run-s clean test:commonjs",
|
"test": "run-s clean test:commonjs",
|
||||||
"test:coverage": "nyc npm run test --all",
|
"test:coverage": "nyc npm run test --all",
|
||||||
"report_test_coverage": "nyc report --reporter=text-lcov | coveralls",
|
"report_test_coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||||
"update_contracts":
|
"update_contracts": "for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../0x.js/src/artifacts; done;",
|
||||||
"for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../0x.js/src/artifacts; done;",
|
|
||||||
"clean": "shx rm -rf _bundles lib test_temp",
|
"clean": "shx rm -rf _bundles lib test_temp",
|
||||||
"build:umd:prod": "NODE_ENV=production webpack",
|
"build:umd:prod": "NODE_ENV=production webpack",
|
||||||
"build:commonjs": "tsc && copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts;",
|
"build:commonjs": "tsc && copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts;",
|
||||||
@@ -38,10 +42,9 @@
|
|||||||
"node": ">=6.0.0"
|
"node": ">=6.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0xproject/abi-gen": "^0.1.2",
|
"@0xproject/abi-gen": "^0.2.1",
|
||||||
"@0xproject/dev-utils": "^0.0.5",
|
"@0xproject/dev-utils": "^0.0.12",
|
||||||
"@0xproject/tslint-config": "^0.4.2",
|
"@0xproject/tslint-config": "^0.4.8",
|
||||||
"@0xproject/types": "^0.1.4",
|
|
||||||
"@types/bintrees": "^1.0.2",
|
"@types/bintrees": "^1.0.2",
|
||||||
"@types/jsonschema": "^1.1.1",
|
"@types/jsonschema": "^1.1.1",
|
||||||
"@types/lodash": "^4.14.86",
|
"@types/lodash": "^4.14.86",
|
||||||
@@ -52,9 +55,9 @@
|
|||||||
"awesome-typescript-loader": "^3.1.3",
|
"awesome-typescript-loader": "^3.1.3",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-as-promised-typescript-typings": "^0.0.4",
|
"chai-as-promised-typescript-typings": "^0.0.9",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.1",
|
||||||
"chai-typescript-typings": "^0.0.2",
|
"chai-typescript-typings": "^0.0.3",
|
||||||
"copyfiles": "^1.2.0",
|
"copyfiles": "^1.2.0",
|
||||||
"coveralls": "^3.0.0",
|
"coveralls": "^3.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
@@ -64,29 +67,31 @@
|
|||||||
"nyc": "^11.0.1",
|
"nyc": "^11.0.1",
|
||||||
"opn-cli": "^3.1.0",
|
"opn-cli": "^3.1.0",
|
||||||
"request": "^2.81.0",
|
"request": "^2.81.0",
|
||||||
"request-promise-native": "^1.0.4",
|
"request-promise-native": "^1.0.5",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"sinon": "^4.0.0",
|
"sinon": "^4.0.0",
|
||||||
"source-map-support": "^0.5.0",
|
"source-map-support": "^0.5.0",
|
||||||
"truffle-hdwallet-provider": "^0.0.3",
|
"truffle-hdwallet-provider": "^0.0.3",
|
||||||
"tslint": "5.8.0",
|
"tslint": "5.8.0",
|
||||||
"typedoc": "~0.8.0",
|
"typedoc": "~0.8.0",
|
||||||
"typescript": "~2.6.1",
|
"types-bn": "^0.0.1",
|
||||||
|
"typescript": "2.7.1",
|
||||||
"web3-provider-engine": "^13.0.1",
|
"web3-provider-engine": "^13.0.1",
|
||||||
"web3-typescript-typings": "^0.9.4",
|
"web3-typescript-typings": "^0.9.10",
|
||||||
"webpack": "^3.1.0"
|
"webpack": "^3.1.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0xproject/assert": "^0.0.11",
|
"@0xproject/assert": "^0.0.18",
|
||||||
"@0xproject/json-schemas": "^0.7.3",
|
"@0xproject/json-schemas": "^0.7.10",
|
||||||
"@0xproject/utils": "^0.2.0",
|
"@0xproject/types": "^0.2.1",
|
||||||
"@0xproject/web3-wrapper": "^0.1.5",
|
"@0xproject/utils": "^0.3.2",
|
||||||
|
"@0xproject/web3-wrapper": "^0.1.12",
|
||||||
"bintrees": "^1.0.2",
|
"bintrees": "^1.0.2",
|
||||||
"bn.js": "^4.11.8",
|
"bn.js": "^4.11.8",
|
||||||
"ethereumjs-abi": "^0.6.4",
|
"ethereumjs-abi": "^0.6.4",
|
||||||
"ethereumjs-blockstream": "^2.0.6",
|
"ethereumjs-blockstream": "^2.0.6",
|
||||||
"ethereumjs-util": "^5.1.1",
|
"ethereumjs-util": "^5.1.1",
|
||||||
"js-sha3": "^0.6.1",
|
"js-sha3": "^0.7.0",
|
||||||
"lodash": "^4.17.4",
|
"lodash": "^4.17.4",
|
||||||
"uuid": "^3.1.0",
|
"uuid": "^3.1.0",
|
||||||
"web3": "^0.20.0"
|
"web3": "^0.20.0"
|
||||||
|
@@ -15,7 +15,7 @@ postpublish_utils
|
|||||||
version = result.version;
|
version = result.version;
|
||||||
const releaseName = postpublish_utils.getReleaseName(subPackageName, version);
|
const releaseName = postpublish_utils.getReleaseName(subPackageName, version);
|
||||||
const assets = [__dirname + '/../_bundles/index.js', __dirname + '/../_bundles/index.min.js'];
|
const assets = [__dirname + '/../_bundles/index.js', __dirname + '/../_bundles/index.min.js'];
|
||||||
return postpublish_utils.publishReleaseNotes(tag, releaseName, assets);
|
return postpublish_utils.publishReleaseNotesAsync(tag, releaseName, assets);
|
||||||
})
|
})
|
||||||
.then(function(release) {
|
.then(function(release) {
|
||||||
console.log('POSTPUBLISH: Release successful, generating docs...');
|
console.log('POSTPUBLISH: Release successful, generating docs...');
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import { schemas, SchemaValidator } from '@0xproject/json-schemas';
|
import { schemas, SchemaValidator } from '@0xproject/json-schemas';
|
||||||
import { BigNumber, intervalUtils } from '@0xproject/utils';
|
import { TransactionReceiptWithDecodedLogs } from '@0xproject/types';
|
||||||
|
import { AbiDecoder, BigNumber, intervalUtils } from '@0xproject/utils';
|
||||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||||
import * as ethUtil from 'ethereumjs-util';
|
import * as ethUtil from 'ethereumjs-util';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
@@ -12,16 +13,7 @@ import { TokenTransferProxyWrapper } from './contract_wrappers/token_transfer_pr
|
|||||||
import { TokenWrapper } from './contract_wrappers/token_wrapper';
|
import { TokenWrapper } from './contract_wrappers/token_wrapper';
|
||||||
import { OrderStateWatcher } from './order_watcher/order_state_watcher';
|
import { OrderStateWatcher } from './order_watcher/order_state_watcher';
|
||||||
import { zeroExConfigSchema } from './schemas/zero_ex_config_schema';
|
import { zeroExConfigSchema } from './schemas/zero_ex_config_schema';
|
||||||
import {
|
import { ECSignature, Order, SignedOrder, Web3Provider, ZeroExConfig, ZeroExError } from './types';
|
||||||
ECSignature,
|
|
||||||
Order,
|
|
||||||
SignedOrder,
|
|
||||||
TransactionReceiptWithDecodedLogs,
|
|
||||||
Web3Provider,
|
|
||||||
ZeroExConfig,
|
|
||||||
ZeroExError,
|
|
||||||
} from './types';
|
|
||||||
import { AbiDecoder } from './utils/abi_decoder';
|
|
||||||
import { assert } from './utils/assert';
|
import { assert } from './utils/assert';
|
||||||
import { constants } from './utils/constants';
|
import { constants } from './utils/constants';
|
||||||
import { decorators } from './utils/decorators';
|
import { decorators } from './utils/decorators';
|
||||||
@@ -240,20 +232,22 @@ export class ZeroEx {
|
|||||||
* @param orderHash Hex encoded orderHash to sign.
|
* @param orderHash Hex encoded orderHash to sign.
|
||||||
* @param signerAddress The hex encoded Ethereum address you wish to sign it with. This address
|
* @param signerAddress The hex encoded Ethereum address you wish to sign it with. This address
|
||||||
* must be available via the Web3.Provider supplied to 0x.js.
|
* must be available via the Web3.Provider supplied to 0x.js.
|
||||||
|
* @param shouldAddPersonalMessagePrefix Some signers add the personal message prefix `\x19Ethereum Signed Message`
|
||||||
|
* themselves (e.g Parity Signer, Ledger, TestRPC) and others expect it to already be done by the client
|
||||||
|
* (e.g Metamask). Depending on which signer this request is going to, decide on whether to add the prefix
|
||||||
|
* before sending the request.
|
||||||
* @return An object containing the Elliptic curve signature parameters generated by signing the orderHash.
|
* @return An object containing the Elliptic curve signature parameters generated by signing the orderHash.
|
||||||
*/
|
*/
|
||||||
public async signOrderHashAsync(orderHash: string, signerAddress: string): Promise<ECSignature> {
|
public async signOrderHashAsync(
|
||||||
|
orderHash: string,
|
||||||
|
signerAddress: string,
|
||||||
|
shouldAddPersonalMessagePrefix: boolean,
|
||||||
|
): Promise<ECSignature> {
|
||||||
assert.isHexString('orderHash', orderHash);
|
assert.isHexString('orderHash', orderHash);
|
||||||
await assert.isSenderAddressAsync('signerAddress', signerAddress, this._web3Wrapper);
|
await assert.isSenderAddressAsync('signerAddress', signerAddress, this._web3Wrapper);
|
||||||
|
|
||||||
let msgHashHex;
|
let msgHashHex = orderHash;
|
||||||
const nodeVersion = await this._web3Wrapper.getNodeVersionAsync();
|
if (shouldAddPersonalMessagePrefix) {
|
||||||
const isParityNode = utils.isParityNode(nodeVersion);
|
|
||||||
const isTestRpc = utils.isTestRpc(nodeVersion);
|
|
||||||
if (isParityNode || isTestRpc) {
|
|
||||||
// Parity and TestRpc nodes add the personalMessage prefix itself
|
|
||||||
msgHashHex = orderHash;
|
|
||||||
} else {
|
|
||||||
const orderHashBuff = ethUtil.toBuffer(orderHash);
|
const orderHashBuff = ethUtil.toBuffer(orderHash);
|
||||||
const msgHashBuff = ethUtil.hashPersonalMessage(orderHashBuff);
|
const msgHashBuff = ethUtil.hashPersonalMessage(orderHashBuff);
|
||||||
msgHashHex = ethUtil.bufferToHex(msgHashBuff);
|
msgHashHex = ethUtil.bufferToHex(msgHashBuff);
|
||||||
@@ -332,8 +326,8 @@ export class ZeroEx {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
const txReceipt = await txReceiptPromise;
|
||||||
return txReceiptPromise;
|
return txReceipt;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* HACK: `TokenWrapper` needs a token transfer proxy address. `TokenTransferProxy` address is fetched from
|
* HACK: `TokenWrapper` needs a token transfer proxy address. `TokenTransferProxy` address is fetched from
|
||||||
|
@@ -274,6 +274,9 @@
|
|||||||
"3": {
|
"3": {
|
||||||
"address": "0xc00fd9820cd2898cc4c054b7bf142de637ad129a"
|
"address": "0xc00fd9820cd2898cc4c054b7bf142de637ad129a"
|
||||||
},
|
},
|
||||||
|
"4": {
|
||||||
|
"address": "0xc778417e063141139fce010982780140aa0cd5ab"
|
||||||
|
},
|
||||||
"42": {
|
"42": {
|
||||||
"address": "0x653e49e301e508a13237c0ddc98ae7d4cd2667a1"
|
"address": "0x653e49e301e508a13237c0ddc98ae7d4cd2667a1"
|
||||||
},
|
},
|
||||||
|
@@ -597,6 +597,9 @@
|
|||||||
"3": {
|
"3": {
|
||||||
"address": "0x479cc461fecd078f766ecc58533d6f69580cf3ac"
|
"address": "0x479cc461fecd078f766ecc58533d6f69580cf3ac"
|
||||||
},
|
},
|
||||||
|
"4": {
|
||||||
|
"address": "0x1d16ef40fac01cec8adac2ac49427b9384192c05"
|
||||||
|
},
|
||||||
"42": {
|
"42": {
|
||||||
"address": "0x90fe2af704b34e0224bf2299c838e04d4dcf1364"
|
"address": "0x90fe2af704b34e0224bf2299c838e04d4dcf1364"
|
||||||
},
|
},
|
||||||
|
@@ -534,6 +534,9 @@
|
|||||||
"3": {
|
"3": {
|
||||||
"address": "0x6b1a50f0bb5a7995444bd3877b22dc89c62843ed"
|
"address": "0x6b1a50f0bb5a7995444bd3877b22dc89c62843ed"
|
||||||
},
|
},
|
||||||
|
"4": {
|
||||||
|
"address": "0x4e9aad8184de8833365fea970cd9149372fdf1e6"
|
||||||
|
},
|
||||||
"42": {
|
"42": {
|
||||||
"address": "0xf18e504561f4347bea557f3d4558f559dddbae7f"
|
"address": "0xf18e504561f4347bea557f3d4558f559dddbae7f"
|
||||||
},
|
},
|
||||||
|
@@ -174,6 +174,9 @@
|
|||||||
"3": {
|
"3": {
|
||||||
"address": "0x4e9aad8184de8833365fea970cd9149372fdf1e6"
|
"address": "0x4e9aad8184de8833365fea970cd9149372fdf1e6"
|
||||||
},
|
},
|
||||||
|
"4": {
|
||||||
|
"address": "0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d"
|
||||||
|
},
|
||||||
"42": {
|
"42": {
|
||||||
"address": "0x087eed4bc1ee3de49befbd66c662b434b15d49d4"
|
"address": "0x087eed4bc1ee3de49befbd66c662b434b15d49d4"
|
||||||
},
|
},
|
||||||
|
@@ -7,6 +7,9 @@
|
|||||||
"3": {
|
"3": {
|
||||||
"address": "0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d"
|
"address": "0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d"
|
||||||
},
|
},
|
||||||
|
"4": {
|
||||||
|
"address": "0x00f58d6d585f84b2d7267940cede30ce2fe6eae8"
|
||||||
|
},
|
||||||
"42": {
|
"42": {
|
||||||
"address": "0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570"
|
"address": "0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570"
|
||||||
},
|
},
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import { intervalUtils } from '@0xproject/utils';
|
import { BlockParamLiteral, LogWithDecodedArgs, RawLog } from '@0xproject/types';
|
||||||
|
import { AbiDecoder, intervalUtils } from '@0xproject/utils';
|
||||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||||
import { Block, BlockAndLogStreamer } from 'ethereumjs-blockstream';
|
import { Block, BlockAndLogStreamer } from 'ethereumjs-blockstream';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
@@ -6,18 +7,14 @@ import * as Web3 from 'web3';
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
Artifact,
|
Artifact,
|
||||||
BlockParamLiteral,
|
|
||||||
BlockRange,
|
BlockRange,
|
||||||
ContractEventArgs,
|
ContractEventArgs,
|
||||||
ContractEvents,
|
ContractEvents,
|
||||||
EventCallback,
|
EventCallback,
|
||||||
IndexedFilterValues,
|
IndexedFilterValues,
|
||||||
InternalZeroExError,
|
InternalZeroExError,
|
||||||
LogWithDecodedArgs,
|
|
||||||
RawLog,
|
|
||||||
ZeroExError,
|
ZeroExError,
|
||||||
} from '../types';
|
} from '../types';
|
||||||
import { AbiDecoder } from '../utils/abi_decoder';
|
|
||||||
import { constants } from '../utils/constants';
|
import { constants } from '../utils/constants';
|
||||||
import { filterUtils } from '../utils/filter_utils';
|
import { filterUtils } from '../utils/filter_utils';
|
||||||
|
|
||||||
@@ -34,10 +31,10 @@ const CONTRACT_NAME_TO_NOT_FOUND_ERROR: {
|
|||||||
|
|
||||||
export class ContractWrapper {
|
export class ContractWrapper {
|
||||||
protected _web3Wrapper: Web3Wrapper;
|
protected _web3Wrapper: Web3Wrapper;
|
||||||
private _networkId: number;
|
protected _networkId: number;
|
||||||
private _abiDecoder?: AbiDecoder;
|
private _abiDecoder?: AbiDecoder;
|
||||||
private _blockAndLogStreamerIfExists: BlockAndLogStreamer | undefined;
|
private _blockAndLogStreamerIfExists?: BlockAndLogStreamer;
|
||||||
private _blockAndLogStreamInterval: NodeJS.Timer;
|
private _blockAndLogStreamIntervalIfExists?: NodeJS.Timer;
|
||||||
private _filters: { [filterToken: string]: Web3.FilterObject };
|
private _filters: { [filterToken: string]: Web3.FilterObject };
|
||||||
private _filterCallbacks: {
|
private _filterCallbacks: {
|
||||||
[filterToken: string]: EventCallback<ContractEventArgs>;
|
[filterToken: string]: EventCallback<ContractEventArgs>;
|
||||||
@@ -54,7 +51,7 @@ export class ContractWrapper {
|
|||||||
this._onLogAddedSubscriptionToken = undefined;
|
this._onLogAddedSubscriptionToken = undefined;
|
||||||
this._onLogRemovedSubscriptionToken = undefined;
|
this._onLogRemovedSubscriptionToken = undefined;
|
||||||
}
|
}
|
||||||
protected unsubscribeAll(): void {
|
protected _unsubscribeAll(): void {
|
||||||
const filterTokens = _.keys(this._filterCallbacks);
|
const filterTokens = _.keys(this._filterCallbacks);
|
||||||
_.each(filterTokens, filterToken => {
|
_.each(filterTokens, filterToken => {
|
||||||
this._unsubscribe(filterToken);
|
this._unsubscribe(filterToken);
|
||||||
@@ -164,7 +161,7 @@ export class ContractWrapper {
|
|||||||
);
|
);
|
||||||
const catchAllLogFilter = {};
|
const catchAllLogFilter = {};
|
||||||
this._blockAndLogStreamerIfExists.addLogFilter(catchAllLogFilter);
|
this._blockAndLogStreamerIfExists.addLogFilter(catchAllLogFilter);
|
||||||
this._blockAndLogStreamInterval = intervalUtils.setAsyncExcludingInterval(
|
this._blockAndLogStreamIntervalIfExists = intervalUtils.setAsyncExcludingInterval(
|
||||||
this._reconcileBlockAsync.bind(this),
|
this._reconcileBlockAsync.bind(this),
|
||||||
constants.DEFAULT_BLOCK_POLLING_INTERVAL,
|
constants.DEFAULT_BLOCK_POLLING_INTERVAL,
|
||||||
this._onReconcileBlockError.bind(this),
|
this._onReconcileBlockError.bind(this),
|
||||||
@@ -193,7 +190,7 @@ export class ContractWrapper {
|
|||||||
}
|
}
|
||||||
this._blockAndLogStreamerIfExists.unsubscribeFromOnLogAdded(this._onLogAddedSubscriptionToken as string);
|
this._blockAndLogStreamerIfExists.unsubscribeFromOnLogAdded(this._onLogAddedSubscriptionToken as string);
|
||||||
this._blockAndLogStreamerIfExists.unsubscribeFromOnLogRemoved(this._onLogRemovedSubscriptionToken as string);
|
this._blockAndLogStreamerIfExists.unsubscribeFromOnLogRemoved(this._onLogRemovedSubscriptionToken as string);
|
||||||
intervalUtils.clearAsyncExcludingInterval(this._blockAndLogStreamInterval);
|
intervalUtils.clearAsyncExcludingInterval(this._blockAndLogStreamIntervalIfExists as NodeJS.Timer);
|
||||||
delete this._blockAndLogStreamerIfExists;
|
delete this._blockAndLogStreamerIfExists;
|
||||||
}
|
}
|
||||||
private async _reconcileBlockAsync(): Promise<void> {
|
private async _reconcileBlockAsync(): Promise<void> {
|
||||||
|
@@ -1,24 +1,15 @@
|
|||||||
import { schemas } from '@0xproject/json-schemas';
|
import { schemas } from '@0xproject/json-schemas';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { LogWithDecodedArgs } from '@0xproject/types';
|
||||||
|
import { AbiDecoder, BigNumber } from '@0xproject/utils';
|
||||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { artifacts } from '../artifacts';
|
import { artifacts } from '../artifacts';
|
||||||
import {
|
import { BlockRange, EventCallback, IndexedFilterValues, TransactionOpts, ZeroExError } from '../types';
|
||||||
BlockRange,
|
|
||||||
EtherTokenContractEventArgs,
|
|
||||||
EtherTokenEvents,
|
|
||||||
EventCallback,
|
|
||||||
IndexedFilterValues,
|
|
||||||
LogWithDecodedArgs,
|
|
||||||
TransactionOpts,
|
|
||||||
ZeroExError,
|
|
||||||
} from '../types';
|
|
||||||
import { AbiDecoder } from '../utils/abi_decoder';
|
|
||||||
import { assert } from '../utils/assert';
|
import { assert } from '../utils/assert';
|
||||||
|
|
||||||
import { ContractWrapper } from './contract_wrapper';
|
import { ContractWrapper } from './contract_wrapper';
|
||||||
import { EtherTokenContract } from './generated/ether_token';
|
import { EtherTokenContract, EtherTokenContractEventArgs, EtherTokenEvents } from './generated/ether_token';
|
||||||
import { TokenWrapper } from './token_wrapper';
|
import { TokenWrapper } from './token_wrapper';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -160,11 +151,24 @@ export class EtherTokenWrapper extends ContractWrapper {
|
|||||||
/**
|
/**
|
||||||
* Cancels all existing subscriptions
|
* Cancels all existing subscriptions
|
||||||
*/
|
*/
|
||||||
public unsubscribeAll(): void {
|
public _unsubscribeAll(): void {
|
||||||
super.unsubscribeAll();
|
super._unsubscribeAll();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Retrieves the Ethereum address of the EtherToken contract deployed on the network
|
||||||
|
* that the user-passed web3 provider is connected to. If it's not Kovan, Ropsten, Rinkeby, Mainnet or TestRPC
|
||||||
|
* (networkId: 50), it will return undefined (e.g a private network).
|
||||||
|
* @returns The Ethereum address of the EtherToken contract or undefined.
|
||||||
|
*/
|
||||||
|
public getContractAddressIfExists(): string | undefined {
|
||||||
|
const networkSpecificArtifact = artifacts.EtherTokenArtifact.networks[this._networkId];
|
||||||
|
const contractAddressIfExists = _.isUndefined(networkSpecificArtifact)
|
||||||
|
? undefined
|
||||||
|
: networkSpecificArtifact.address;
|
||||||
|
return contractAddressIfExists;
|
||||||
}
|
}
|
||||||
private _invalidateContractInstance(): void {
|
private _invalidateContractInstance(): void {
|
||||||
this.unsubscribeAll();
|
this._unsubscribeAll();
|
||||||
this._etherTokenContractsByAddress = {};
|
this._etherTokenContractsByAddress = {};
|
||||||
}
|
}
|
||||||
private async _getEtherTokenContractAsync(etherTokenAddress: string): Promise<EtherTokenContract> {
|
private async _getEtherTokenContractAsync(etherTokenAddress: string): Promise<EtherTokenContract> {
|
||||||
|
@@ -1,23 +1,18 @@
|
|||||||
import { schemas } from '@0xproject/json-schemas';
|
import { schemas } from '@0xproject/json-schemas';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BlockParamLiteral, DecodedLogArgs, LogWithDecodedArgs } from '@0xproject/types';
|
||||||
|
import { AbiDecoder, BigNumber } from '@0xproject/utils';
|
||||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
import * as Web3 from 'web3';
|
import * as Web3 from 'web3';
|
||||||
|
|
||||||
import { artifacts } from '../artifacts';
|
import { artifacts } from '../artifacts';
|
||||||
import {
|
import {
|
||||||
BlockParamLiteral,
|
|
||||||
BlockRange,
|
BlockRange,
|
||||||
DecodedLogArgs,
|
|
||||||
ECSignature,
|
ECSignature,
|
||||||
EventCallback,
|
EventCallback,
|
||||||
ExchangeContractErrCodes,
|
ExchangeContractErrCodes,
|
||||||
ExchangeContractErrs,
|
ExchangeContractErrs,
|
||||||
ExchangeContractEventArgs,
|
|
||||||
ExchangeEvents,
|
|
||||||
IndexedFilterValues,
|
IndexedFilterValues,
|
||||||
LogErrorContractEventArgs,
|
|
||||||
LogWithDecodedArgs,
|
|
||||||
MethodOpts,
|
MethodOpts,
|
||||||
Order,
|
Order,
|
||||||
OrderAddresses,
|
OrderAddresses,
|
||||||
@@ -28,7 +23,6 @@ import {
|
|||||||
SignedOrder,
|
SignedOrder,
|
||||||
ValidateOrderFillableOpts,
|
ValidateOrderFillableOpts,
|
||||||
} from '../types';
|
} from '../types';
|
||||||
import { AbiDecoder } from '../utils/abi_decoder';
|
|
||||||
import { assert } from '../utils/assert';
|
import { assert } from '../utils/assert';
|
||||||
import { decorators } from '../utils/decorators';
|
import { decorators } from '../utils/decorators';
|
||||||
import { ExchangeTransferSimulator } from '../utils/exchange_transfer_simulator';
|
import { ExchangeTransferSimulator } from '../utils/exchange_transfer_simulator';
|
||||||
@@ -36,7 +30,12 @@ import { OrderValidationUtils } from '../utils/order_validation_utils';
|
|||||||
import { utils } from '../utils/utils';
|
import { utils } from '../utils/utils';
|
||||||
|
|
||||||
import { ContractWrapper } from './contract_wrapper';
|
import { ContractWrapper } from './contract_wrapper';
|
||||||
import { ExchangeContract } from './generated/exchange';
|
import {
|
||||||
|
ExchangeContract,
|
||||||
|
ExchangeContractEventArgs,
|
||||||
|
ExchangeEvents,
|
||||||
|
LogErrorContractEventArgs,
|
||||||
|
} from './generated/exchange';
|
||||||
import { TokenWrapper } from './token_wrapper';
|
import { TokenWrapper } from './token_wrapper';
|
||||||
|
|
||||||
const SHOULD_VALIDATE_BY_DEFAULT = true;
|
const SHOULD_VALIDATE_BY_DEFAULT = true;
|
||||||
@@ -680,8 +679,8 @@ export class ExchangeWrapper extends ContractWrapper {
|
|||||||
/**
|
/**
|
||||||
* Cancels all existing subscriptions
|
* Cancels all existing subscriptions
|
||||||
*/
|
*/
|
||||||
public unsubscribeAll(): void {
|
public _unsubscribeAll(): void {
|
||||||
super.unsubscribeAll();
|
super._unsubscribeAll();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Gets historical logs without creating a subscription
|
* Gets historical logs without creating a subscription
|
||||||
@@ -846,9 +845,9 @@ export class ExchangeWrapper extends ContractWrapper {
|
|||||||
public throwLogErrorsAsErrors(logs: Array<LogWithDecodedArgs<DecodedLogArgs> | Web3.LogEntry>): void {
|
public throwLogErrorsAsErrors(logs: Array<LogWithDecodedArgs<DecodedLogArgs> | Web3.LogEntry>): void {
|
||||||
const errLog = _.find(logs, {
|
const errLog = _.find(logs, {
|
||||||
event: ExchangeEvents.LogError,
|
event: ExchangeEvents.LogError,
|
||||||
}) as LogWithDecodedArgs<LogErrorContractEventArgs> | undefined;
|
});
|
||||||
if (!_.isUndefined(errLog)) {
|
if (!_.isUndefined(errLog)) {
|
||||||
const logArgs = errLog.args;
|
const logArgs = (errLog as LogWithDecodedArgs<LogErrorContractEventArgs>).args;
|
||||||
const errCode = logArgs.errorId.toNumber();
|
const errCode = logArgs.errorId.toNumber();
|
||||||
const errMessage = this._exchangeContractErrCodesToMsg[errCode];
|
const errMessage = this._exchangeContractErrCodesToMsg[errCode];
|
||||||
throw new Error(errMessage);
|
throw new Error(errMessage);
|
||||||
@@ -863,7 +862,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
|||||||
return contractAddress;
|
return contractAddress;
|
||||||
}
|
}
|
||||||
private _invalidateContractInstances(): void {
|
private _invalidateContractInstances(): void {
|
||||||
this.unsubscribeAll();
|
this._unsubscribeAll();
|
||||||
delete this._exchangeContractIfExists;
|
delete this._exchangeContractIfExists;
|
||||||
}
|
}
|
||||||
private async _isValidSignatureUsingContractCallAsync(
|
private async _isValidSignatureUsingContractCallAsync(
|
||||||
|
@@ -3,9 +3,9 @@ import * as _ from 'lodash';
|
|||||||
import * as Web3 from 'web3';
|
import * as Web3 from 'web3';
|
||||||
|
|
||||||
export class BaseContract {
|
export class BaseContract {
|
||||||
protected web3ContractInstance: Web3.ContractInstance;
|
protected _web3ContractInstance: Web3.ContractInstance;
|
||||||
protected defaults: Partial<TxData>;
|
protected _defaults: Partial<TxData>;
|
||||||
protected async applyDefaultsToTxDataAsync<T extends TxData|TxDataPayable>(
|
protected async _applyDefaultsToTxDataAsync<T extends TxData|TxDataPayable>(
|
||||||
txData: T,
|
txData: T,
|
||||||
estimateGasAsync?: (txData: T) => Promise<number>,
|
estimateGasAsync?: (txData: T) => Promise<number>,
|
||||||
): Promise<TxData> {
|
): Promise<TxData> {
|
||||||
@@ -15,7 +15,7 @@ export class BaseContract {
|
|||||||
// 3. Gas estimate calculation + safety margin
|
// 3. Gas estimate calculation + safety margin
|
||||||
const removeUndefinedProperties = _.pickBy;
|
const removeUndefinedProperties = _.pickBy;
|
||||||
const txDataWithDefaults = {
|
const txDataWithDefaults = {
|
||||||
...removeUndefinedProperties(this.defaults),
|
...removeUndefinedProperties(this._defaults),
|
||||||
...removeUndefinedProperties(txData as any),
|
...removeUndefinedProperties(txData as any),
|
||||||
// HACK: TS can't prove that T is spreadable.
|
// HACK: TS can't prove that T is spreadable.
|
||||||
// Awaiting https://github.com/Microsoft/TypeScript/pull/13288 to be merged
|
// Awaiting https://github.com/Microsoft/TypeScript/pull/13288 to be merged
|
||||||
@@ -27,7 +27,7 @@ export class BaseContract {
|
|||||||
return txDataWithDefaults;
|
return txDataWithDefaults;
|
||||||
}
|
}
|
||||||
constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) {
|
constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) {
|
||||||
this.web3ContractInstance = web3ContractInstance;
|
this._web3ContractInstance = web3ContractInstance;
|
||||||
this.defaults = defaults;
|
this._defaults = defaults;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,26 +1,16 @@
|
|||||||
import { schemas } from '@0xproject/json-schemas';
|
import { schemas } from '@0xproject/json-schemas';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { LogWithDecodedArgs } from '@0xproject/types';
|
||||||
|
import { AbiDecoder, BigNumber } from '@0xproject/utils';
|
||||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { artifacts } from '../artifacts';
|
import { artifacts } from '../artifacts';
|
||||||
import {
|
import { BlockRange, EventCallback, IndexedFilterValues, MethodOpts, TransactionOpts, ZeroExError } from '../types';
|
||||||
BlockRange,
|
|
||||||
EventCallback,
|
|
||||||
IndexedFilterValues,
|
|
||||||
LogWithDecodedArgs,
|
|
||||||
MethodOpts,
|
|
||||||
TokenContractEventArgs,
|
|
||||||
TokenEvents,
|
|
||||||
TransactionOpts,
|
|
||||||
ZeroExError,
|
|
||||||
} from '../types';
|
|
||||||
import { AbiDecoder } from '../utils/abi_decoder';
|
|
||||||
import { assert } from '../utils/assert';
|
import { assert } from '../utils/assert';
|
||||||
import { constants } from '../utils/constants';
|
import { constants } from '../utils/constants';
|
||||||
|
|
||||||
import { ContractWrapper } from './contract_wrapper';
|
import { ContractWrapper } from './contract_wrapper';
|
||||||
import { TokenContract } from './generated/token';
|
import { TokenContract, TokenContractEventArgs, TokenEvents } from './generated/token';
|
||||||
import { TokenTransferProxyWrapper } from './token_transfer_proxy_wrapper';
|
import { TokenTransferProxyWrapper } from './token_transfer_proxy_wrapper';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -343,8 +333,8 @@ export class TokenWrapper extends ContractWrapper {
|
|||||||
/**
|
/**
|
||||||
* Cancels all existing subscriptions
|
* Cancels all existing subscriptions
|
||||||
*/
|
*/
|
||||||
public unsubscribeAll(): void {
|
public _unsubscribeAll(): void {
|
||||||
super.unsubscribeAll();
|
super._unsubscribeAll();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Gets historical logs without creating a subscription
|
* Gets historical logs without creating a subscription
|
||||||
@@ -375,7 +365,7 @@ export class TokenWrapper extends ContractWrapper {
|
|||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
private _invalidateContractInstances(): void {
|
private _invalidateContractInstances(): void {
|
||||||
this.unsubscribeAll();
|
this._unsubscribeAll();
|
||||||
this._tokenContractsByAddress = {};
|
this._tokenContractsByAddress = {};
|
||||||
}
|
}
|
||||||
private async _getTokenContractAsync(tokenAddress: string): Promise<TokenContract> {
|
private async _getTokenContractAsync(tokenAddress: string): Promise<TokenContract> {
|
||||||
|
16
packages/0x.js/src/globals.d.ts
vendored
16
packages/0x.js/src/globals.d.ts
vendored
@@ -41,19 +41,3 @@ declare module 'truffle-hdwallet-provider' {
|
|||||||
}
|
}
|
||||||
export = HDWalletProvider;
|
export = HDWalletProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
// abi-decoder declarations
|
|
||||||
interface DecodedLogArg {}
|
|
||||||
interface DecodedLog {
|
|
||||||
name: string;
|
|
||||||
events: DecodedLogArg[];
|
|
||||||
}
|
|
||||||
declare module 'abi-decoder' {
|
|
||||||
import * as Web3 from 'web3';
|
|
||||||
const addABI: (abi: Web3.AbiDefinition) => void;
|
|
||||||
const decodeLogs: (logs: Web3.LogEntry[]) => DecodedLog[];
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'web3/lib/solidity/coder' {
|
|
||||||
const decodeParams: (types: string[], data: string) => any[];
|
|
||||||
}
|
|
||||||
|
@@ -2,7 +2,6 @@ export { ZeroEx } from './0x';
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
Order,
|
Order,
|
||||||
BlockParamLiteral,
|
|
||||||
SignedOrder,
|
SignedOrder,
|
||||||
ECSignature,
|
ECSignature,
|
||||||
ZeroExError,
|
ZeroExError,
|
||||||
@@ -10,30 +9,13 @@ export {
|
|||||||
ExchangeContractErrs,
|
ExchangeContractErrs,
|
||||||
ContractEvent,
|
ContractEvent,
|
||||||
Token,
|
Token,
|
||||||
ExchangeEvents,
|
|
||||||
TokenEvents,
|
|
||||||
IndexedFilterValues,
|
IndexedFilterValues,
|
||||||
BlockRange,
|
BlockRange,
|
||||||
BlockParam,
|
|
||||||
OrderCancellationRequest,
|
OrderCancellationRequest,
|
||||||
OrderFillRequest,
|
OrderFillRequest,
|
||||||
LogErrorContractEventArgs,
|
|
||||||
LogCancelContractEventArgs,
|
|
||||||
LogFillContractEventArgs,
|
|
||||||
ExchangeContractEventArgs,
|
|
||||||
TransferContractEventArgs,
|
|
||||||
ApprovalContractEventArgs,
|
|
||||||
TokenContractEventArgs,
|
|
||||||
EtherTokenContractEventArgs,
|
|
||||||
WithdrawalContractEventArgs,
|
|
||||||
DepositContractEventArgs,
|
|
||||||
ContractEventArgs,
|
ContractEventArgs,
|
||||||
ContractEventArg,
|
|
||||||
Web3Provider,
|
Web3Provider,
|
||||||
ZeroExConfig,
|
ZeroExConfig,
|
||||||
EtherTokenEvents,
|
|
||||||
TransactionReceiptWithDecodedLogs,
|
|
||||||
LogWithDecodedArgs,
|
|
||||||
MethodOpts,
|
MethodOpts,
|
||||||
OrderTransactionOpts,
|
OrderTransactionOpts,
|
||||||
TransactionOpts,
|
TransactionOpts,
|
||||||
@@ -47,4 +29,34 @@ export {
|
|||||||
OrderState,
|
OrderState,
|
||||||
} from './types';
|
} from './types';
|
||||||
|
|
||||||
|
export {
|
||||||
|
BlockParamLiteral,
|
||||||
|
BlockParam,
|
||||||
|
ContractEventArg,
|
||||||
|
LogWithDecodedArgs,
|
||||||
|
TransactionReceiptWithDecodedLogs,
|
||||||
|
} from '@0xproject/types';
|
||||||
|
|
||||||
|
export {
|
||||||
|
EtherTokenContractEventArgs,
|
||||||
|
WithdrawalContractEventArgs,
|
||||||
|
DepositContractEventArgs,
|
||||||
|
EtherTokenEvents,
|
||||||
|
} from './contract_wrappers/generated/ether_token';
|
||||||
|
|
||||||
|
export {
|
||||||
|
TransferContractEventArgs,
|
||||||
|
ApprovalContractEventArgs,
|
||||||
|
TokenContractEventArgs,
|
||||||
|
TokenEvents,
|
||||||
|
} from './contract_wrappers/generated/token';
|
||||||
|
|
||||||
|
export {
|
||||||
|
LogErrorContractEventArgs,
|
||||||
|
LogCancelContractEventArgs,
|
||||||
|
LogFillContractEventArgs,
|
||||||
|
ExchangeContractEventArgs,
|
||||||
|
ExchangeEvents,
|
||||||
|
} from './contract_wrappers/generated/exchange';
|
||||||
|
|
||||||
export { TransactionReceipt } from '@0xproject/types';
|
export { TransactionReceipt } from '@0xproject/types';
|
||||||
|
@@ -3,7 +3,9 @@ import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
|||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
import * as Web3 from 'web3';
|
import * as Web3 from 'web3';
|
||||||
|
|
||||||
import { BlockParamLiteral, EventWatcherCallback, ZeroExError } from '../types';
|
import { BlockParamLiteral } from '@0xproject/types';
|
||||||
|
|
||||||
|
import { EventWatcherCallback, ZeroExError } from '../types';
|
||||||
import { assert } from '../utils/assert';
|
import { assert } from '../utils/assert';
|
||||||
|
|
||||||
const DEFAULT_EVENT_POLLING_INTERVAL_MS = 200;
|
const DEFAULT_EVENT_POLLING_INTERVAL_MS = 200;
|
||||||
|
@@ -1,35 +1,39 @@
|
|||||||
import { schemas } from '@0xproject/json-schemas';
|
import { schemas } from '@0xproject/json-schemas';
|
||||||
import { intervalUtils } from '@0xproject/utils';
|
import { BlockParamLiteral, LogWithDecodedArgs } from '@0xproject/types';
|
||||||
|
import { AbiDecoder, intervalUtils } from '@0xproject/utils';
|
||||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { ZeroEx } from '../0x';
|
import { ZeroEx } from '../0x';
|
||||||
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
|
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
|
||||||
|
import {
|
||||||
|
DepositContractEventArgs,
|
||||||
|
EtherTokenEvents,
|
||||||
|
WithdrawalContractEventArgs,
|
||||||
|
} from '../contract_wrappers/generated/ether_token';
|
||||||
|
import {
|
||||||
|
ExchangeEvents,
|
||||||
|
LogCancelContractEventArgs,
|
||||||
|
LogFillContractEventArgs,
|
||||||
|
} from '../contract_wrappers/generated/exchange';
|
||||||
|
import {
|
||||||
|
ApprovalContractEventArgs,
|
||||||
|
TokenEvents,
|
||||||
|
TransferContractEventArgs,
|
||||||
|
} from '../contract_wrappers/generated/token';
|
||||||
import { TokenWrapper } from '../contract_wrappers/token_wrapper';
|
import { TokenWrapper } from '../contract_wrappers/token_wrapper';
|
||||||
import { BalanceAndProxyAllowanceLazyStore } from '../stores/balance_proxy_allowance_lazy_store';
|
import { BalanceAndProxyAllowanceLazyStore } from '../stores/balance_proxy_allowance_lazy_store';
|
||||||
import { OrderFilledCancelledLazyStore } from '../stores/order_filled_cancelled_lazy_store';
|
import { OrderFilledCancelledLazyStore } from '../stores/order_filled_cancelled_lazy_store';
|
||||||
import {
|
import {
|
||||||
ApprovalContractEventArgs,
|
|
||||||
BlockParamLiteral,
|
|
||||||
ContractEventArgs,
|
ContractEventArgs,
|
||||||
DepositContractEventArgs,
|
|
||||||
EtherTokenEvents,
|
|
||||||
ExchangeContractErrs,
|
ExchangeContractErrs,
|
||||||
ExchangeEvents,
|
|
||||||
LogCancelContractEventArgs,
|
|
||||||
LogEvent,
|
LogEvent,
|
||||||
LogFillContractEventArgs,
|
|
||||||
LogWithDecodedArgs,
|
|
||||||
OnOrderStateChangeCallback,
|
OnOrderStateChangeCallback,
|
||||||
OrderState,
|
OrderState,
|
||||||
OrderStateWatcherConfig,
|
OrderStateWatcherConfig,
|
||||||
SignedOrder,
|
SignedOrder,
|
||||||
TokenEvents,
|
|
||||||
TransferContractEventArgs,
|
|
||||||
WithdrawalContractEventArgs,
|
|
||||||
ZeroExError,
|
ZeroExError,
|
||||||
} from '../types';
|
} from '../types';
|
||||||
import { AbiDecoder } from '../utils/abi_decoder';
|
|
||||||
import { assert } from '../utils/assert';
|
import { assert } from '../utils/assert';
|
||||||
import { OrderStateUtils } from '../utils/order_state_utils';
|
import { OrderStateUtils } from '../utils/order_state_utils';
|
||||||
import { utils } from '../utils/utils';
|
import { utils } from '../utils/utils';
|
||||||
@@ -134,8 +138,12 @@ export class OrderStateWatcher {
|
|||||||
delete this._orderStateByOrderHashCache[orderHash];
|
delete this._orderStateByOrderHashCache[orderHash];
|
||||||
const exchange = (this._orderFilledCancelledLazyStore as any)._exchange as ExchangeWrapper;
|
const exchange = (this._orderFilledCancelledLazyStore as any)._exchange as ExchangeWrapper;
|
||||||
const zrxTokenAddress = exchange.getZRXTokenAddress();
|
const zrxTokenAddress = exchange.getZRXTokenAddress();
|
||||||
|
|
||||||
this._removeFromDependentOrderHashes(signedOrder.maker, zrxTokenAddress, orderHash);
|
this._removeFromDependentOrderHashes(signedOrder.maker, zrxTokenAddress, orderHash);
|
||||||
this._removeFromDependentOrderHashes(signedOrder.maker, signedOrder.makerTokenAddress, orderHash);
|
if (zrxTokenAddress !== signedOrder.makerTokenAddress) {
|
||||||
|
this._removeFromDependentOrderHashes(signedOrder.maker, signedOrder.makerTokenAddress, orderHash);
|
||||||
|
}
|
||||||
|
|
||||||
this._expirationWatcher.removeOrder(orderHash);
|
this._expirationWatcher.removeOrder(orderHash);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -224,12 +232,12 @@ export class OrderStateWatcher {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const log = logIfExists as LogEvent; // At this moment we are sure that no error occured and log is defined.
|
const log = logIfExists as LogEvent; // At this moment we are sure that no error occured and log is defined.
|
||||||
const maybeDecodedLog = this._abiDecoder.tryToDecodeLogOrNoop(log);
|
const maybeDecodedLog = this._abiDecoder.tryToDecodeLogOrNoop<ContractEventArgs>(log);
|
||||||
const isLogDecoded = !_.isUndefined((maybeDecodedLog as LogWithDecodedArgs<any>).event);
|
const isLogDecoded = !_.isUndefined(((maybeDecodedLog as any) as LogWithDecodedArgs<ContractEventArgs>).event);
|
||||||
if (!isLogDecoded) {
|
if (!isLogDecoded) {
|
||||||
return; // noop
|
return; // noop
|
||||||
}
|
}
|
||||||
const decodedLog = maybeDecodedLog as LogWithDecodedArgs<ContractEventArgs>;
|
const decodedLog = (maybeDecodedLog as any) as LogWithDecodedArgs<ContractEventArgs>;
|
||||||
let makerToken: string;
|
let makerToken: string;
|
||||||
let makerAddress: string;
|
let makerAddress: string;
|
||||||
switch (decodedLog.event) {
|
switch (decodedLog.event) {
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
|
import { BlockParamLiteral } from '@0xproject/types';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { TokenWrapper } from '../contract_wrappers/token_wrapper';
|
import { TokenWrapper } from '../contract_wrappers/token_wrapper';
|
||||||
import { BlockParamLiteral } from '../types';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy on read store for balances/proxyAllowances of tokens/accounts
|
* Copy on read store for balances/proxyAllowances of tokens/accounts
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
|
import { BlockParamLiteral } from '@0xproject/types';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
|
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
|
||||||
import { BlockParamLiteral } from '../types';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy on read store for filled/cancelled taker amounts
|
* Copy on read store for filled/cancelled taker amounts
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
import { TransactionReceipt } from '@0xproject/types';
|
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
|
|
||||||
|
import { BlockParam, BlockParamLiteral, ContractEventArg, LogWithDecodedArgs } from '@0xproject/types';
|
||||||
|
|
||||||
import * as Web3 from 'web3';
|
import * as Web3 from 'web3';
|
||||||
|
|
||||||
|
import { EtherTokenContractEventArgs, EtherTokenEvents } from './contract_wrappers/generated/ether_token';
|
||||||
|
import { ExchangeContractEventArgs, ExchangeEvents } from './contract_wrappers/generated/exchange';
|
||||||
|
import { TokenContractEventArgs, TokenEvents } from './contract_wrappers/generated/token';
|
||||||
|
|
||||||
export enum ZeroExError {
|
export enum ZeroExError {
|
||||||
ExchangeContractDoesNotExist = 'EXCHANGE_CONTRACT_DOES_NOT_EXIST',
|
ExchangeContractDoesNotExist = 'EXCHANGE_CONTRACT_DOES_NOT_EXIST',
|
||||||
ZRXContractDoesNotExist = 'ZRX_CONTRACT_DOES_NOT_EXIST',
|
ZRXContractDoesNotExist = 'ZRX_CONTRACT_DOES_NOT_EXIST',
|
||||||
@@ -53,13 +59,6 @@ export interface DecodedLogEvent<ArgsType> {
|
|||||||
export type EventCallback<ArgsType> = (err: null | Error, log?: DecodedLogEvent<ArgsType>) => void;
|
export type EventCallback<ArgsType> = (err: null | Error, log?: DecodedLogEvent<ArgsType>) => void;
|
||||||
export type EventWatcherCallback = (err: null | Error, log?: LogEvent) => void;
|
export type EventWatcherCallback = (err: null | Error, log?: LogEvent) => void;
|
||||||
|
|
||||||
export enum SolidityTypes {
|
|
||||||
Address = 'address',
|
|
||||||
Uint256 = 'uint256',
|
|
||||||
Uint8 = 'uint8',
|
|
||||||
Uint = 'uint',
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum ExchangeContractErrCodes {
|
export enum ExchangeContractErrCodes {
|
||||||
ERROR_FILL_EXPIRED, // Order has already expired
|
ERROR_FILL_EXPIRED, // Order has already expired
|
||||||
ERROR_FILL_NO_VALUE, // Order has already been fully filled or cancelled
|
ERROR_FILL_NO_VALUE, // Order has already been fully filled or cancelled
|
||||||
@@ -94,8 +93,6 @@ export enum ExchangeContractErrs {
|
|||||||
BatchOrdersMustHaveAtLeastOneItem = 'BATCH_ORDERS_MUST_HAVE_AT_LEAST_ONE_ITEM',
|
BatchOrdersMustHaveAtLeastOneItem = 'BATCH_ORDERS_MUST_HAVE_AT_LEAST_ONE_ITEM',
|
||||||
}
|
}
|
||||||
|
|
||||||
export type RawLog = Web3.LogEntry;
|
|
||||||
|
|
||||||
export interface ContractEvent {
|
export interface ContractEvent {
|
||||||
logIndex: number;
|
logIndex: number;
|
||||||
transactionIndex: number;
|
transactionIndex: number;
|
||||||
@@ -108,62 +105,7 @@ export interface ContractEvent {
|
|||||||
args: ContractEventArgs;
|
args: ContractEventArgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LogFillContractEventArgs {
|
|
||||||
maker: string;
|
|
||||||
taker: string;
|
|
||||||
feeRecipient: string;
|
|
||||||
makerToken: string;
|
|
||||||
takerToken: string;
|
|
||||||
filledMakerTokenAmount: BigNumber;
|
|
||||||
filledTakerTokenAmount: BigNumber;
|
|
||||||
paidMakerFee: BigNumber;
|
|
||||||
paidTakerFee: BigNumber;
|
|
||||||
tokens: string;
|
|
||||||
orderHash: string;
|
|
||||||
}
|
|
||||||
export interface LogCancelContractEventArgs {
|
|
||||||
maker: string;
|
|
||||||
feeRecipient: string;
|
|
||||||
makerToken: string;
|
|
||||||
takerToken: string;
|
|
||||||
cancelledMakerTokenAmount: BigNumber;
|
|
||||||
cancelledTakerTokenAmount: BigNumber;
|
|
||||||
tokens: string;
|
|
||||||
orderHash: string;
|
|
||||||
}
|
|
||||||
export interface LogErrorContractEventArgs {
|
|
||||||
errorId: BigNumber;
|
|
||||||
orderHash: string;
|
|
||||||
}
|
|
||||||
export type ExchangeContractEventArgs =
|
|
||||||
| LogFillContractEventArgs
|
|
||||||
| LogCancelContractEventArgs
|
|
||||||
| LogErrorContractEventArgs;
|
|
||||||
export interface TransferContractEventArgs {
|
|
||||||
_from: string;
|
|
||||||
_to: string;
|
|
||||||
_value: BigNumber;
|
|
||||||
}
|
|
||||||
export interface ApprovalContractEventArgs {
|
|
||||||
_owner: string;
|
|
||||||
_spender: string;
|
|
||||||
_value: BigNumber;
|
|
||||||
}
|
|
||||||
export interface DepositContractEventArgs {
|
|
||||||
_owner: string;
|
|
||||||
_value: BigNumber;
|
|
||||||
}
|
|
||||||
export interface WithdrawalContractEventArgs {
|
|
||||||
_owner: string;
|
|
||||||
_value: BigNumber;
|
|
||||||
}
|
|
||||||
export type TokenContractEventArgs = TransferContractEventArgs | ApprovalContractEventArgs;
|
|
||||||
export type EtherTokenContractEventArgs =
|
|
||||||
| TokenContractEventArgs
|
|
||||||
| DepositContractEventArgs
|
|
||||||
| WithdrawalContractEventArgs;
|
|
||||||
export type ContractEventArgs = ExchangeContractEventArgs | TokenContractEventArgs | EtherTokenContractEventArgs;
|
export type ContractEventArgs = ExchangeContractEventArgs | TokenContractEventArgs | EtherTokenContractEventArgs;
|
||||||
export type ContractEventArg = string | BigNumber;
|
|
||||||
|
|
||||||
export interface Order {
|
export interface Order {
|
||||||
maker: string;
|
maker: string;
|
||||||
@@ -205,40 +147,12 @@ export interface TokenAddressBySymbol {
|
|||||||
[symbol: string]: string;
|
[symbol: string]: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ExchangeEvents {
|
|
||||||
LogFill = 'LogFill',
|
|
||||||
LogCancel = 'LogCancel',
|
|
||||||
LogError = 'LogError',
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum TokenEvents {
|
|
||||||
Transfer = 'Transfer',
|
|
||||||
Approval = 'Approval',
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EtherTokenEvents {
|
|
||||||
Transfer = 'Transfer',
|
|
||||||
Approval = 'Approval',
|
|
||||||
Deposit = 'Deposit',
|
|
||||||
Withdrawal = 'Withdrawal',
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ContractEvents = TokenEvents | ExchangeEvents | EtherTokenEvents;
|
export type ContractEvents = TokenEvents | ExchangeEvents | EtherTokenEvents;
|
||||||
|
|
||||||
export interface IndexedFilterValues {
|
export interface IndexedFilterValues {
|
||||||
[index: string]: ContractEventArg;
|
[index: string]: ContractEventArg;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Earliest is omitted by design. It is simply an alias for the `0` constant and
|
|
||||||
// is thus not very helpful. Moreover, this type is used in places that only accept
|
|
||||||
// `latest` or `pending`.
|
|
||||||
export enum BlockParamLiteral {
|
|
||||||
Latest = 'latest',
|
|
||||||
Pending = 'pending',
|
|
||||||
}
|
|
||||||
|
|
||||||
export type BlockParam = BlockParamLiteral | number;
|
|
||||||
|
|
||||||
export interface BlockRange {
|
export interface BlockRange {
|
||||||
fromBlock: BlockParam;
|
fromBlock: BlockParam;
|
||||||
toBlock: BlockParam;
|
toBlock: BlockParam;
|
||||||
@@ -267,11 +181,6 @@ export type SyncMethod = (...args: any[]) => any;
|
|||||||
*/
|
*/
|
||||||
export type Web3Provider = Web3.Provider;
|
export type Web3Provider = Web3.Provider;
|
||||||
|
|
||||||
export interface JSONRPCPayload {
|
|
||||||
params: any[];
|
|
||||||
method: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* orderExpirationCheckingIntervalMs: How often to check for expired orders. Default: 50
|
* orderExpirationCheckingIntervalMs: How often to check for expired orders. Default: 50
|
||||||
* eventPollingIntervalMs: How often to poll the Ethereum node for new events. Defaults: 200
|
* eventPollingIntervalMs: How often to poll the Ethereum node for new events. Defaults: 200
|
||||||
@@ -305,23 +214,6 @@ export interface ZeroExConfig {
|
|||||||
orderWatcherConfig?: OrderStateWatcherConfig;
|
orderWatcherConfig?: OrderStateWatcherConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum AbiType {
|
|
||||||
Function = 'function',
|
|
||||||
Constructor = 'constructor',
|
|
||||||
Event = 'event',
|
|
||||||
Fallback = 'fallback',
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DecodedLogArgs {
|
|
||||||
[argName: string]: ContractEventArg;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface LogWithDecodedArgs<ArgsType> extends Web3.DecodedLogEntry<ArgsType> {}
|
|
||||||
|
|
||||||
export interface TransactionReceiptWithDecodedLogs extends TransactionReceipt {
|
|
||||||
logs: Array<LogWithDecodedArgs<DecodedLogArgs> | Web3.LogEntry>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ArtifactContractName = 'ZRX' | 'TokenTransferProxy' | 'TokenRegistry' | 'Token' | 'Exchange' | 'EtherToken';
|
export type ArtifactContractName = 'ZRX' | 'TokenTransferProxy' | 'TokenRegistry' | 'Token' | 'Exchange' | 'EtherToken';
|
||||||
|
|
||||||
export interface Artifact {
|
export interface Artifact {
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
|
import { BlockParamLiteral } from '@0xproject/types';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { TokenWrapper } from '../contract_wrappers/token_wrapper';
|
import { TokenWrapper } from '../contract_wrappers/token_wrapper';
|
||||||
import { BalanceAndProxyAllowanceLazyStore } from '../stores/balance_proxy_allowance_lazy_store';
|
import { BalanceAndProxyAllowanceLazyStore } from '../stores/balance_proxy_allowance_lazy_store';
|
||||||
import { BlockParamLiteral, ExchangeContractErrs, TradeSide, TransferType } from '../types';
|
import { ExchangeContractErrs, TradeSide, TransferType } from '../types';
|
||||||
|
|
||||||
enum FailureReason {
|
enum FailureReason {
|
||||||
Balance = 'balance',
|
Balance = 'balance',
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
|
import { SolidityTypes } from '@0xproject/types';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import BN = require('bn.js');
|
import BN = require('bn.js');
|
||||||
import * as ethABI from 'ethereumjs-abi';
|
import * as ethABI from 'ethereumjs-abi';
|
||||||
import * as ethUtil from 'ethereumjs-util';
|
import * as ethUtil from 'ethereumjs-util';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { Order, SignedOrder, SolidityTypes } from '../types';
|
import { Order, SignedOrder } from '../types';
|
||||||
|
|
||||||
export const utils = {
|
export const utils = {
|
||||||
/**
|
/**
|
||||||
@@ -20,12 +21,6 @@ export const utils = {
|
|||||||
// tslint:disable-next-line: no-console
|
// tslint:disable-next-line: no-console
|
||||||
console.log(message);
|
console.log(message);
|
||||||
},
|
},
|
||||||
isParityNode(nodeVersion: string): boolean {
|
|
||||||
return _.includes(nodeVersion, 'Parity');
|
|
||||||
},
|
|
||||||
isTestRpc(nodeVersion: string): boolean {
|
|
||||||
return _.includes(nodeVersion, 'TestRPC');
|
|
||||||
},
|
|
||||||
spawnSwitchErr(name: string, value: any): Error {
|
spawnSwitchErr(name: string, value: any): Error {
|
||||||
return new Error(`Unexpected switch value: ${value} encountered for ${name}`);
|
return new Error(`Unexpected switch value: ${value} encountered for ${name}`);
|
||||||
},
|
},
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { BlockchainLifecycle } from '@0xproject/dev-utils';
|
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
@@ -10,12 +10,13 @@ import { ApprovalContractEventArgs, LogWithDecodedArgs, Order, TokenEvents, Zero
|
|||||||
import { chaiSetup } from './utils/chai_setup';
|
import { chaiSetup } from './utils/chai_setup';
|
||||||
import { constants } from './utils/constants';
|
import { constants } from './utils/constants';
|
||||||
import { TokenUtils } from './utils/token_utils';
|
import { TokenUtils } from './utils/token_utils';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
const blockchainLifecycle = new BlockchainLifecycle();
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
|
|
||||||
|
const SHOULD_ADD_PERSONAL_MESSAGE_PREFIX = false;
|
||||||
|
|
||||||
describe('ZeroEx library', () => {
|
describe('ZeroEx library', () => {
|
||||||
const web3 = web3Factory.create();
|
const web3 = web3Factory.create();
|
||||||
const config = {
|
const config = {
|
||||||
@@ -198,7 +199,11 @@ describe('ZeroEx library', () => {
|
|||||||
r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
|
r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
|
||||||
s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
|
s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
|
||||||
};
|
};
|
||||||
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, makerAddress);
|
const ecSignature = await zeroEx.signOrderHashAsync(
|
||||||
|
orderHash,
|
||||||
|
makerAddress,
|
||||||
|
SHOULD_ADD_PERSONAL_MESSAGE_PREFIX,
|
||||||
|
);
|
||||||
expect(ecSignature).to.deep.equal(expectedECSignature);
|
expect(ecSignature).to.deep.equal(expectedECSignature);
|
||||||
});
|
});
|
||||||
it('should return the correct ECSignature for signatureHex concatenated as R + S + V', async () => {
|
it('should return the correct ECSignature for signatureHex concatenated as R + S + V', async () => {
|
||||||
@@ -215,7 +220,11 @@ describe('ZeroEx library', () => {
|
|||||||
Sinon.stub(ZeroEx, 'isValidSignature').returns(true),
|
Sinon.stub(ZeroEx, 'isValidSignature').returns(true),
|
||||||
];
|
];
|
||||||
|
|
||||||
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, makerAddress);
|
const ecSignature = await zeroEx.signOrderHashAsync(
|
||||||
|
orderHash,
|
||||||
|
makerAddress,
|
||||||
|
SHOULD_ADD_PERSONAL_MESSAGE_PREFIX,
|
||||||
|
);
|
||||||
expect(ecSignature).to.deep.equal(expectedECSignature);
|
expect(ecSignature).to.deep.equal(expectedECSignature);
|
||||||
});
|
});
|
||||||
it('should return the correct ECSignature for signatureHex concatenated as V + R + S', async () => {
|
it('should return the correct ECSignature for signatureHex concatenated as V + R + S', async () => {
|
||||||
@@ -232,7 +241,11 @@ describe('ZeroEx library', () => {
|
|||||||
Sinon.stub(ZeroEx, 'isValidSignature').returns(true),
|
Sinon.stub(ZeroEx, 'isValidSignature').returns(true),
|
||||||
];
|
];
|
||||||
|
|
||||||
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, makerAddress);
|
const ecSignature = await zeroEx.signOrderHashAsync(
|
||||||
|
orderHash,
|
||||||
|
makerAddress,
|
||||||
|
SHOULD_ADD_PERSONAL_MESSAGE_PREFIX,
|
||||||
|
);
|
||||||
expect(ecSignature).to.deep.equal(expectedECSignature);
|
expect(ecSignature).to.deep.equal(expectedECSignature);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import { web3Factory } from '@0xproject/dev-utils';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import 'mocha';
|
import 'mocha';
|
||||||
|
|
||||||
@@ -5,7 +6,6 @@ import { ZeroEx } from '../src';
|
|||||||
import { assert } from '../src/utils/assert';
|
import { assert } from '../src/utils/assert';
|
||||||
|
|
||||||
import { constants } from './utils/constants';
|
import { constants } from './utils/constants';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { BlockchainLifecycle } from '@0xproject/dev-utils';
|
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import 'mocha';
|
import 'mocha';
|
||||||
@@ -17,18 +17,16 @@ import {
|
|||||||
ZeroEx,
|
ZeroEx,
|
||||||
ZeroExError,
|
ZeroExError,
|
||||||
} from '../src';
|
} from '../src';
|
||||||
import { artifacts } from '../src/artifacts';
|
|
||||||
import { DoneCallback } from '../src/types';
|
import { DoneCallback } from '../src/types';
|
||||||
|
|
||||||
import { chaiSetup } from './utils/chai_setup';
|
import { chaiSetup } from './utils/chai_setup';
|
||||||
import { constants } from './utils/constants';
|
import { constants } from './utils/constants';
|
||||||
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
|
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
|
||||||
import { TokenUtils } from './utils/token_utils';
|
import { TokenUtils } from './utils/token_utils';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
const blockchainLifecycle = new BlockchainLifecycle();
|
||||||
|
|
||||||
// Since the address depositing/withdrawing ETH/WETH also needs to pay gas costs for the transaction,
|
// Since the address depositing/withdrawing ETH/WETH also needs to pay gas costs for the transaction,
|
||||||
// a small amount of ETH will be used to pay this gas cost. We therefore check that the difference between
|
// a small amount of ETH will be used to pay this gas cost. We therefore check that the difference between
|
||||||
@@ -61,7 +59,7 @@ describe('EtherTokenWrapper', () => {
|
|||||||
tokens = await zeroEx.tokenRegistry.getTokensAsync();
|
tokens = await zeroEx.tokenRegistry.getTokensAsync();
|
||||||
userAddresses = await zeroEx.getAvailableAddressesAsync();
|
userAddresses = await zeroEx.getAvailableAddressesAsync();
|
||||||
addressWithETH = userAddresses[0];
|
addressWithETH = userAddresses[0];
|
||||||
wethContractAddress = (zeroEx.etherToken as any)._getContractAddress(artifacts.EtherTokenArtifact);
|
wethContractAddress = zeroEx.etherToken.getContractAddressIfExists() as string;
|
||||||
depositWeiAmount = (zeroEx as any)._web3Wrapper.toWei(new BigNumber(5));
|
depositWeiAmount = (zeroEx as any)._web3Wrapper.toWei(new BigNumber(5));
|
||||||
decimalPlaces = 7;
|
decimalPlaces = 7;
|
||||||
addressWithoutFunds = userAddresses[1];
|
addressWithoutFunds = userAddresses[1];
|
||||||
@@ -72,6 +70,18 @@ describe('EtherTokenWrapper', () => {
|
|||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
await blockchainLifecycle.revertAsync();
|
await blockchainLifecycle.revertAsync();
|
||||||
});
|
});
|
||||||
|
describe('#getContractAddressIfExists', async () => {
|
||||||
|
it('should return contract address if connected to a known network', () => {
|
||||||
|
const contractAddressIfExists = zeroEx.etherToken.getContractAddressIfExists();
|
||||||
|
expect(contractAddressIfExists).to.not.be.undefined();
|
||||||
|
});
|
||||||
|
it('should return undefined if connected to an unknown network', () => {
|
||||||
|
const UNKNOWN_NETWORK_NETWORK_ID = 10;
|
||||||
|
const unknownNetworkZeroEx = new ZeroEx(web3.currentProvider, { networkId: UNKNOWN_NETWORK_NETWORK_ID });
|
||||||
|
const contractAddressIfExists = unknownNetworkZeroEx.etherToken.getContractAddressIfExists();
|
||||||
|
expect(contractAddressIfExists).to.be.undefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
describe('#depositAsync', () => {
|
describe('#depositAsync', () => {
|
||||||
it('should successfully deposit ETH and issue Wrapped ETH tokens', async () => {
|
it('should successfully deposit ETH and issue Wrapped ETH tokens', async () => {
|
||||||
const preETHBalance = await (zeroEx as any)._web3Wrapper.getBalanceInWeiAsync(addressWithETH);
|
const preETHBalance = await (zeroEx as any)._web3Wrapper.getBalanceInWeiAsync(addressWithETH);
|
||||||
@@ -145,7 +155,7 @@ describe('EtherTokenWrapper', () => {
|
|||||||
etherTokenAddress = etherToken.address;
|
etherTokenAddress = etherToken.address;
|
||||||
});
|
});
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
zeroEx.etherToken.unsubscribeAll();
|
zeroEx.etherToken._unsubscribeAll();
|
||||||
});
|
});
|
||||||
// Hack: Mocha does not allow a test to be both async and have a `done` callback
|
// Hack: Mocha does not allow a test to be both async and have a `done` callback
|
||||||
// Since we need to await the receipt of the event in the `subscribe` callback,
|
// Since we need to await the receipt of the event in the `subscribe` callback,
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import { web3Factory } from '@0xproject/dev-utils';
|
||||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
@@ -11,7 +12,6 @@ import { DoneCallback } from '../src/types';
|
|||||||
|
|
||||||
import { chaiSetup } from './utils/chai_setup';
|
import { chaiSetup } from './utils/chai_setup';
|
||||||
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
|
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
|
@@ -1,18 +1,18 @@
|
|||||||
import { BlockchainLifecycle } from '@0xproject/dev-utils';
|
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
|
||||||
|
import { BlockParamLiteral } from '@0xproject/types';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
|
|
||||||
import { ExchangeContractErrs, Token, ZeroEx } from '../src';
|
import { ExchangeContractErrs, Token, ZeroEx } from '../src';
|
||||||
import { BlockParamLiteral, TradeSide, TransferType } from '../src/types';
|
import { TradeSide, TransferType } from '../src/types';
|
||||||
import { ExchangeTransferSimulator } from '../src/utils/exchange_transfer_simulator';
|
import { ExchangeTransferSimulator } from '../src/utils/exchange_transfer_simulator';
|
||||||
|
|
||||||
import { chaiSetup } from './utils/chai_setup';
|
import { chaiSetup } from './utils/chai_setup';
|
||||||
import { constants } from './utils/constants';
|
import { constants } from './utils/constants';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
const blockchainLifecycle = new BlockchainLifecycle();
|
||||||
|
|
||||||
describe('ExchangeTransferSimulator', () => {
|
describe('ExchangeTransferSimulator', () => {
|
||||||
const web3 = web3Factory.create();
|
const web3 = web3Factory.create();
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import { BlockchainLifecycle } from '@0xproject/dev-utils';
|
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
|
||||||
|
import { BlockParamLiteral } from '@0xproject/types';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
@@ -18,18 +19,17 @@ import {
|
|||||||
Token,
|
Token,
|
||||||
ZeroEx,
|
ZeroEx,
|
||||||
} from '../src';
|
} from '../src';
|
||||||
import { BlockParamLiteral, DoneCallback } from '../src/types';
|
import { DoneCallback } from '../src/types';
|
||||||
|
|
||||||
import { chaiSetup } from './utils/chai_setup';
|
import { chaiSetup } from './utils/chai_setup';
|
||||||
import { constants } from './utils/constants';
|
import { constants } from './utils/constants';
|
||||||
import { FillScenarios } from './utils/fill_scenarios';
|
import { FillScenarios } from './utils/fill_scenarios';
|
||||||
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
|
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
|
||||||
import { TokenUtils } from './utils/token_utils';
|
import { TokenUtils } from './utils/token_utils';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
const blockchainLifecycle = new BlockchainLifecycle();
|
||||||
|
|
||||||
const NON_EXISTENT_ORDER_HASH = '0x79370342234e7acd6bbeac335bd3bb1d368383294b64b8160a00f4060e4d3777';
|
const NON_EXISTENT_ORDER_HASH = '0x79370342234e7acd6bbeac335bd3bb1d368383294b64b8160a00f4060e4d3777';
|
||||||
|
|
||||||
@@ -922,7 +922,7 @@ describe('ExchangeWrapper', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
zeroEx.exchange.unsubscribeAll();
|
zeroEx.exchange._unsubscribeAll();
|
||||||
});
|
});
|
||||||
// Hack: Mocha does not allow a test to be both async and have a `done` callback
|
// Hack: Mocha does not allow a test to be both async and have a `done` callback
|
||||||
// Since we need to await the receipt of the event in the `subscribe` callback,
|
// Since we need to await the receipt of the event in the `subscribe` callback,
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { BlockchainLifecycle } from '@0xproject/dev-utils';
|
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
@@ -13,15 +13,13 @@ import { constants } from '../src/utils/constants';
|
|||||||
import { utils } from '../src/utils/utils';
|
import { utils } from '../src/utils/utils';
|
||||||
|
|
||||||
import { chaiSetup } from './utils/chai_setup';
|
import { chaiSetup } from './utils/chai_setup';
|
||||||
import { constants as testConstants } from './utils/constants';
|
|
||||||
import { FillScenarios } from './utils/fill_scenarios';
|
import { FillScenarios } from './utils/fill_scenarios';
|
||||||
import { reportNoErrorCallbackErrors } from './utils/report_callback_errors';
|
import { reportNoErrorCallbackErrors } from './utils/report_callback_errors';
|
||||||
import { TokenUtils } from './utils/token_utils';
|
import { TokenUtils } from './utils/token_utils';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(testConstants.RPC_URL);
|
const blockchainLifecycle = new BlockchainLifecycle();
|
||||||
|
|
||||||
describe('ExpirationWatcher', () => {
|
describe('ExpirationWatcher', () => {
|
||||||
let web3: Web3;
|
let web3: Web3;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { BlockchainLifecycle } from '@0xproject/dev-utils';
|
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
@@ -22,13 +22,12 @@ import { constants } from './utils/constants';
|
|||||||
import { FillScenarios } from './utils/fill_scenarios';
|
import { FillScenarios } from './utils/fill_scenarios';
|
||||||
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
|
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
|
||||||
import { TokenUtils } from './utils/token_utils';
|
import { TokenUtils } from './utils/token_utils';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
const TIMEOUT_MS = 150;
|
const TIMEOUT_MS = 150;
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
const blockchainLifecycle = new BlockchainLifecycle();
|
||||||
|
|
||||||
describe('OrderStateWatcher', () => {
|
describe('OrderStateWatcher', () => {
|
||||||
let web3: Web3;
|
let web3: Web3;
|
||||||
|
@@ -1,11 +1,12 @@
|
|||||||
import { BlockchainLifecycle } from '@0xproject/dev-utils';
|
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
|
||||||
|
import { BlockParamLiteral } from '@0xproject/types';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import * as Sinon from 'sinon';
|
import * as Sinon from 'sinon';
|
||||||
import * as Web3 from 'web3';
|
import * as Web3 from 'web3';
|
||||||
|
|
||||||
import { ExchangeContractErrs, SignedOrder, Token, ZeroEx, ZeroExError } from '../src';
|
import { ExchangeContractErrs, SignedOrder, Token, ZeroEx, ZeroExError } from '../src';
|
||||||
import { BlockParamLiteral, TradeSide, TransferType } from '../src/types';
|
import { TradeSide, TransferType } from '../src/types';
|
||||||
import { ExchangeTransferSimulator } from '../src/utils/exchange_transfer_simulator';
|
import { ExchangeTransferSimulator } from '../src/utils/exchange_transfer_simulator';
|
||||||
import { OrderValidationUtils } from '../src/utils/order_validation_utils';
|
import { OrderValidationUtils } from '../src/utils/order_validation_utils';
|
||||||
|
|
||||||
@@ -13,11 +14,10 @@ import { chaiSetup } from './utils/chai_setup';
|
|||||||
import { constants } from './utils/constants';
|
import { constants } from './utils/constants';
|
||||||
import { FillScenarios } from './utils/fill_scenarios';
|
import { FillScenarios } from './utils/fill_scenarios';
|
||||||
import { TokenUtils } from './utils/token_utils';
|
import { TokenUtils } from './utils/token_utils';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
const blockchainLifecycle = new BlockchainLifecycle();
|
||||||
|
|
||||||
describe('OrderValidation', () => {
|
describe('OrderValidation', () => {
|
||||||
let web3: Web3;
|
let web3: Web3;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { BlockchainLifecycle } from '@0xproject/dev-utils';
|
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
import 'mocha';
|
import 'mocha';
|
||||||
@@ -11,10 +11,9 @@ import { DoneCallback } from '../src/types';
|
|||||||
import { chaiSetup } from './utils/chai_setup';
|
import { chaiSetup } from './utils/chai_setup';
|
||||||
import { constants } from './utils/constants';
|
import { constants } from './utils/constants';
|
||||||
import { assertNodeCallbackError } from './utils/report_callback_errors';
|
import { assertNodeCallbackError } from './utils/report_callback_errors';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
const blockchainLifecycle = new BlockchainLifecycle();
|
||||||
|
|
||||||
describe('SubscriptionTest', () => {
|
describe('SubscriptionTest', () => {
|
||||||
let web3: Web3;
|
let web3: Web3;
|
||||||
@@ -50,7 +49,7 @@ describe('SubscriptionTest', () => {
|
|||||||
tokenAddress = token.address;
|
tokenAddress = token.address;
|
||||||
});
|
});
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
zeroEx.token.unsubscribeAll();
|
zeroEx.token._unsubscribeAll();
|
||||||
_.each(stubs, s => s.restore());
|
_.each(stubs, s => s.restore());
|
||||||
stubs = [];
|
stubs = [];
|
||||||
});
|
});
|
||||||
@@ -77,7 +76,7 @@ describe('SubscriptionTest', () => {
|
|||||||
const callback = (err: Error | null, logEvent?: DecodedLogEvent<ApprovalContractEventArgs>) => _.noop;
|
const callback = (err: Error | null, logEvent?: DecodedLogEvent<ApprovalContractEventArgs>) => _.noop;
|
||||||
zeroEx.token.subscribe(tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
|
zeroEx.token.subscribe(tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
|
||||||
stubs = [Sinon.stub((zeroEx as any)._web3Wrapper, 'getBlockAsync').throws(new Error('JSON RPC error'))];
|
stubs = [Sinon.stub((zeroEx as any)._web3Wrapper, 'getBlockAsync').throws(new Error('JSON RPC error'))];
|
||||||
zeroEx.token.unsubscribeAll();
|
zeroEx.token._unsubscribeAll();
|
||||||
done();
|
done();
|
||||||
})().catch(done);
|
})().catch(done);
|
||||||
});
|
});
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { BlockchainLifecycle } from '@0xproject/dev-utils';
|
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
|
||||||
import { schemas, SchemaValidator } from '@0xproject/json-schemas';
|
import { schemas, SchemaValidator } from '@0xproject/json-schemas';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
@@ -8,11 +8,10 @@ import { Token, ZeroEx } from '../src';
|
|||||||
|
|
||||||
import { chaiSetup } from './utils/chai_setup';
|
import { chaiSetup } from './utils/chai_setup';
|
||||||
import { constants } from './utils/constants';
|
import { constants } from './utils/constants';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
const blockchainLifecycle = new BlockchainLifecycle();
|
||||||
|
|
||||||
const TOKEN_REGISTRY_SIZE_AFTER_MIGRATION = 7;
|
const TOKEN_REGISTRY_SIZE_AFTER_MIGRATION = 7;
|
||||||
|
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
|
import { web3Factory } from '@0xproject/dev-utils';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
|
|
||||||
import { ZeroEx } from '../src';
|
import { ZeroEx } from '../src';
|
||||||
|
|
||||||
import { chaiSetup } from './utils/chai_setup';
|
import { chaiSetup } from './utils/chai_setup';
|
||||||
import { constants } from './utils/constants';
|
import { constants } from './utils/constants';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { BlockchainLifecycle } from '@0xproject/dev-utils';
|
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
@@ -22,11 +22,10 @@ import { chaiSetup } from './utils/chai_setup';
|
|||||||
import { constants } from './utils/constants';
|
import { constants } from './utils/constants';
|
||||||
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
|
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
|
||||||
import { TokenUtils } from './utils/token_utils';
|
import { TokenUtils } from './utils/token_utils';
|
||||||
import { web3Factory } from './utils/web3_factory';
|
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
const blockchainLifecycle = new BlockchainLifecycle();
|
||||||
|
|
||||||
describe('TokenWrapper', () => {
|
describe('TokenWrapper', () => {
|
||||||
let web3: Web3;
|
let web3: Web3;
|
||||||
@@ -378,7 +377,7 @@ describe('TokenWrapper', () => {
|
|||||||
tokenAddress = token.address;
|
tokenAddress = token.address;
|
||||||
});
|
});
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
zeroEx.token.unsubscribeAll();
|
zeroEx.token._unsubscribeAll();
|
||||||
});
|
});
|
||||||
// Hack: Mocha does not allow a test to be both async and have a `done` callback
|
// Hack: Mocha does not allow a test to be both async and have a `done` callback
|
||||||
// Since we need to await the receipt of the event in the `subscribe` callback,
|
// Since we need to await the receipt of the event in the `subscribe` callback,
|
||||||
|
@@ -1,11 +1,9 @@
|
|||||||
export const constants = {
|
export const constants = {
|
||||||
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
|
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
|
||||||
RPC_URL: 'http://localhost:8545',
|
|
||||||
ROPSTEN_NETWORK_ID: 3,
|
ROPSTEN_NETWORK_ID: 3,
|
||||||
KOVAN_NETWORK_ID: 42,
|
KOVAN_NETWORK_ID: 42,
|
||||||
TESTRPC_NETWORK_ID: 50,
|
TESTRPC_NETWORK_ID: 50,
|
||||||
KOVAN_RPC_URL: 'https://kovan.infura.io/',
|
KOVAN_RPC_URL: 'https://kovan.infura.io/',
|
||||||
ROPSTEN_RPC_URL: 'https://ropsten.infura.io/',
|
ROPSTEN_RPC_URL: 'https://ropsten.infura.io/',
|
||||||
ZRX_DECIMALS: 18,
|
ZRX_DECIMALS: 18,
|
||||||
GAS_ESTIMATE: 500000,
|
|
||||||
};
|
};
|
||||||
|
@@ -3,6 +3,8 @@ import * as _ from 'lodash';
|
|||||||
|
|
||||||
import { SignedOrder, ZeroEx } from '../../src';
|
import { SignedOrder, ZeroEx } from '../../src';
|
||||||
|
|
||||||
|
const SHOULD_ADD_PERSONAL_MESSAGE_PREFIX = false;
|
||||||
|
|
||||||
export const orderFactory = {
|
export const orderFactory = {
|
||||||
async createSignedOrderAsync(
|
async createSignedOrderAsync(
|
||||||
zeroEx: ZeroEx,
|
zeroEx: ZeroEx,
|
||||||
@@ -37,7 +39,7 @@ export const orderFactory = {
|
|||||||
expirationUnixTimestampSec,
|
expirationUnixTimestampSec,
|
||||||
};
|
};
|
||||||
const orderHash = ZeroEx.getOrderHashHex(order);
|
const orderHash = ZeroEx.getOrderHashHex(order);
|
||||||
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, maker);
|
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, maker, SHOULD_ADD_PERSONAL_MESSAGE_PREFIX);
|
||||||
const signedOrder: SignedOrder = _.assign(order, { ecSignature });
|
const signedOrder: SignedOrder = _.assign(order, { ecSignature });
|
||||||
return signedOrder;
|
return signedOrder;
|
||||||
},
|
},
|
||||||
|
5
packages/abi-gen/.npmignore
Normal file
5
packages/abi-gen/.npmignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
.*
|
||||||
|
yarn-error.log
|
||||||
|
/src/
|
||||||
|
/scripts/
|
||||||
|
tsconfig.json
|
@@ -1,7 +1,16 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## v0.2.1 - _February 9, 2018_
|
||||||
|
|
||||||
|
* Fix publishing issue where .npmignore was not properly excluding undesired content (#389)
|
||||||
|
|
||||||
|
## v0.2.0 - _February 7, 2018_
|
||||||
|
|
||||||
|
* Added CLI options for explicit specifying location of partials and main template (#346)
|
||||||
|
* Added CLI option to specify networkId, adding support for the JSON artifact format found in @0xproject/contracts (#388)
|
||||||
|
|
||||||
## v0.1.0 - _January 11, 2018_
|
## v0.1.0 - _January 11, 2018_
|
||||||
|
|
||||||
* Fixed array typings with union types (#295)
|
* Fixed array typings with union types (#295)
|
||||||
* Add event ABIs to context data passed to templates (#302)
|
* Add event ABIs to context data passed to templates (#302)
|
||||||
* Add constructor ABIs to context data passed to templates (#304)
|
* Add constructor ABIs to context data passed to templates (#304)
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@0xproject/abi-gen",
|
"name": "@0xproject/abi-gen",
|
||||||
"version": "0.1.2",
|
"version": "0.2.1",
|
||||||
"description": "Generate contract wrappers from ABI and handlebars templates",
|
"description": "Generate contract wrappers from ABI and handlebars templates",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"build:watch": "tsc -w",
|
||||||
"lint": "tslint --project . 'src/**/*.ts'",
|
"lint": "tslint --project . 'src/**/*.ts'",
|
||||||
"clean": "shx rm -rf lib",
|
"clean": "shx rm -rf lib",
|
||||||
"build": "tsc"
|
"build": "tsc"
|
||||||
@@ -22,7 +23,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x.js/packages/abi-gen/README.md",
|
"homepage": "https://github.com/0xProject/0x.js/packages/abi-gen/README.md",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0xproject/utils": "^0.2.0",
|
"@0xproject/utils": "^0.3.2",
|
||||||
"chalk": "^2.3.0",
|
"chalk": "^2.3.0",
|
||||||
"glob": "^7.1.2",
|
"glob": "^7.1.2",
|
||||||
"handlebars": "^4.0.11",
|
"handlebars": "^4.0.11",
|
||||||
@@ -33,7 +34,7 @@
|
|||||||
"yargs": "^10.0.3"
|
"yargs": "^10.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0xproject/tslint-config": "^0.4.2",
|
"@0xproject/tslint-config": "^0.4.8",
|
||||||
"@types/glob": "^5.0.33",
|
"@types/glob": "^5.0.33",
|
||||||
"@types/handlebars": "^4.0.36",
|
"@types/handlebars": "^4.0.36",
|
||||||
"@types/mkdirp": "^0.5.1",
|
"@types/mkdirp": "^0.5.1",
|
||||||
@@ -42,7 +43,7 @@
|
|||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"tslint": "5.8.0",
|
"tslint": "5.8.0",
|
||||||
"typescript": "~2.6.1",
|
"typescript": "2.7.1",
|
||||||
"web3-typescript-typings": "^0.9.4"
|
"web3-typescript-typings": "^0.9.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,14 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
|
|||||||
const packageJSON = require('../package.json');
|
const packageJSON = require('../package.json');
|
||||||
|
|
||||||
const subPackageName = packageJSON.name;
|
const subPackageName = packageJSON.name;
|
||||||
|
postpublish_utils.standardPostPublishAsync(subPackageName);
|
||||||
postpublish_utils
|
|
||||||
.getLatestTagAndVersionAsync(subPackageName)
|
|
||||||
.then(function(result) {
|
|
||||||
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
|
|
||||||
const assets = [];
|
|
||||||
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
|
|
||||||
})
|
|
||||||
.catch(function(err) {
|
|
||||||
throw err;
|
|
||||||
});
|
|
@@ -17,27 +17,57 @@ import { utils } from './utils';
|
|||||||
const ABI_TYPE_CONSTRUCTOR = 'constructor';
|
const ABI_TYPE_CONSTRUCTOR = 'constructor';
|
||||||
const ABI_TYPE_METHOD = 'function';
|
const ABI_TYPE_METHOD = 'function';
|
||||||
const ABI_TYPE_EVENT = 'event';
|
const ABI_TYPE_EVENT = 'event';
|
||||||
const MAIN_TEMPLATE_NAME = 'contract.mustache';
|
const DEFAULT_NETWORK_ID = 50;
|
||||||
|
|
||||||
const args = yargs
|
const args = yargs
|
||||||
.option('abiGlob', {
|
.option('abis', {
|
||||||
describe: 'Glob pattern to search for ABI JSON files',
|
describe: 'Glob pattern to search for ABI JSON files',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
demand: true,
|
demandOption: true,
|
||||||
})
|
|
||||||
.option('templates', {
|
|
||||||
describe: 'Folder where to search for templates',
|
|
||||||
type: 'string',
|
|
||||||
demand: true,
|
|
||||||
})
|
})
|
||||||
.option('output', {
|
.option('output', {
|
||||||
|
alias: ['o', 'out'],
|
||||||
describe: 'Folder where to put the output files',
|
describe: 'Folder where to put the output files',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
demand: true,
|
normalize: true,
|
||||||
}).argv;
|
demandOption: true,
|
||||||
|
})
|
||||||
|
.option('partials', {
|
||||||
|
describe: 'Glob pattern for the partial template files',
|
||||||
|
type: 'string',
|
||||||
|
implies: 'template',
|
||||||
|
})
|
||||||
|
.option('template', {
|
||||||
|
describe: 'Path for the main template file that will be used to generate each contract',
|
||||||
|
type: 'string',
|
||||||
|
demandOption: true,
|
||||||
|
normalize: true,
|
||||||
|
})
|
||||||
|
.option('network-id', {
|
||||||
|
describe: 'ID of the network where contract ABIs are nested in artifacts',
|
||||||
|
type: 'number',
|
||||||
|
default: DEFAULT_NETWORK_ID,
|
||||||
|
})
|
||||||
|
.example(
|
||||||
|
"$0 --abis 'src/artifacts/**/*.json' --out 'src/contracts/generated/' --partials 'src/templates/partials/**/*.handlebars' --template 'src/templates/contract.handlebars'",
|
||||||
|
'Full usage example',
|
||||||
|
).argv;
|
||||||
|
|
||||||
|
function registerPartials(partialsGlob: string) {
|
||||||
|
const partialTemplateFileNames = globSync(partialsGlob);
|
||||||
|
utils.log(`Found ${chalk.green(`${partialTemplateFileNames.length}`)} ${chalk.bold('partial')} templates`);
|
||||||
|
for (const partialTemplateFileName of partialTemplateFileNames) {
|
||||||
|
const namedContent = utils.getNamedContent(partialTemplateFileName);
|
||||||
|
Handlebars.registerPartial(namedContent.name, namedContent.content);
|
||||||
|
}
|
||||||
|
return partialsGlob;
|
||||||
|
}
|
||||||
|
|
||||||
function writeOutputFile(name: string, renderedTsCode: string): void {
|
function writeOutputFile(name: string, renderedTsCode: string): void {
|
||||||
const fileName = toSnakeCase(name);
|
let fileName = toSnakeCase(name);
|
||||||
|
if (fileName === 'z_r_x_token') {
|
||||||
|
fileName = 'zrx_token';
|
||||||
|
}
|
||||||
const filePath = `${args.output}/${fileName}.ts`;
|
const filePath = `${args.output}/${fileName}.ts`;
|
||||||
fs.writeFileSync(filePath, renderedTsCode);
|
fs.writeFileSync(filePath, renderedTsCode);
|
||||||
utils.log(`Created: ${chalk.bold(filePath)}`);
|
utils.log(`Created: ${chalk.bold(filePath)}`);
|
||||||
@@ -45,15 +75,14 @@ function writeOutputFile(name: string, renderedTsCode: string): void {
|
|||||||
|
|
||||||
Handlebars.registerHelper('parameterType', utils.solTypeToTsType.bind(utils, ParamKind.Input));
|
Handlebars.registerHelper('parameterType', utils.solTypeToTsType.bind(utils, ParamKind.Input));
|
||||||
Handlebars.registerHelper('returnType', utils.solTypeToTsType.bind(utils, ParamKind.Output));
|
Handlebars.registerHelper('returnType', utils.solTypeToTsType.bind(utils, ParamKind.Output));
|
||||||
const partialTemplateFileNames = globSync(`${args.templates}/partials/**/*.mustache`);
|
|
||||||
for (const partialTemplateFileName of partialTemplateFileNames) {
|
|
||||||
const namedContent = utils.getNamedContent(partialTemplateFileName);
|
|
||||||
Handlebars.registerPartial(namedContent.name, namedContent.content);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mainTemplate = utils.getNamedContent(`${args.templates}/${MAIN_TEMPLATE_NAME}`);
|
if (args.partials) {
|
||||||
|
registerPartials(args.partials);
|
||||||
|
}
|
||||||
|
const mainTemplate = utils.getNamedContent(args.template);
|
||||||
const template = Handlebars.compile<ContextData>(mainTemplate.content);
|
const template = Handlebars.compile<ContextData>(mainTemplate.content);
|
||||||
const abiFileNames = globSync(args.abiGlob);
|
const abiFileNames = globSync(args.abis);
|
||||||
|
|
||||||
if (_.isEmpty(abiFileNames)) {
|
if (_.isEmpty(abiFileNames)) {
|
||||||
utils.log(`${chalk.red(`No ABI files found.`)}`);
|
utils.log(`${chalk.red(`No ABI files found.`)}`);
|
||||||
utils.log(`Please make sure you've passed the correct folder name and that the files have
|
utils.log(`Please make sure you've passed the correct folder name and that the files have
|
||||||
@@ -67,12 +96,19 @@ for (const abiFileName of abiFileNames) {
|
|||||||
const namedContent = utils.getNamedContent(abiFileName);
|
const namedContent = utils.getNamedContent(abiFileName);
|
||||||
utils.log(`Processing: ${chalk.bold(namedContent.name)}...`);
|
utils.log(`Processing: ${chalk.bold(namedContent.name)}...`);
|
||||||
const parsedContent = JSON.parse(namedContent.content);
|
const parsedContent = JSON.parse(namedContent.content);
|
||||||
const ABI = _.isArray(parsedContent)
|
let ABI;
|
||||||
? parsedContent // ABI file
|
if (_.isArray(parsedContent)) {
|
||||||
: parsedContent.abi; // Truffle contracts file
|
ABI = parsedContent; // ABI file
|
||||||
|
} else if (!_.isUndefined(parsedContent.abi)) {
|
||||||
|
ABI = parsedContent.abi; // Truffle artifact
|
||||||
|
} else if (!_.isUndefined(parsedContent.networks) && !_.isUndefined(parsedContent.networks[args.networkId])) {
|
||||||
|
ABI = parsedContent.networks[args.networkId].abi; // 0x contracts package artifact
|
||||||
|
}
|
||||||
if (_.isUndefined(ABI)) {
|
if (_.isUndefined(ABI)) {
|
||||||
utils.log(`${chalk.red(`ABI not found in ${abiFileName}.`)}`);
|
utils.log(`${chalk.red(`ABI not found in ${abiFileName}.`)}`);
|
||||||
utils.log(`Please make sure your ABI file is either an array with ABI entries or an object with the abi key`);
|
utils.log(
|
||||||
|
`Please make sure your ABI file is either an array with ABI entries or a truffle artifact or 0x deployer artifact`,
|
||||||
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,10 +119,10 @@ for (const abiFileName of abiFileNames) {
|
|||||||
|
|
||||||
const methodAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_METHOD) as Web3.MethodAbi[];
|
const methodAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_METHOD) as Web3.MethodAbi[];
|
||||||
const methodsData = _.map(methodAbis, methodAbi => {
|
const methodsData = _.map(methodAbis, methodAbi => {
|
||||||
_.map(methodAbi.inputs, input => {
|
_.map(methodAbi.inputs, (input, i: number) => {
|
||||||
if (_.isEmpty(input.name)) {
|
if (_.isEmpty(input.name)) {
|
||||||
// Auto-generated getters don't have parameter names
|
// Auto-generated getters don't have parameter names
|
||||||
input.name = 'index';
|
input.name = `index_${i}`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// This will make templates simpler
|
// This will make templates simpler
|
||||||
|
6
packages/assert/.npmignore
Normal file
6
packages/assert/.npmignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.*
|
||||||
|
yarn-error.log
|
||||||
|
/src/
|
||||||
|
/scripts/
|
||||||
|
test/
|
||||||
|
tsconfig.json
|
@@ -1,6 +1,10 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
## v0.0.4 - _Nov. 14, 2017_
|
## v0.0.18 - _February 9, 2017_
|
||||||
|
|
||||||
|
* Fix publishing issue where .npmignore was not properly excluding undesired content (#389)
|
||||||
|
|
||||||
|
## v0.0.4 - _November 14, 2017_
|
||||||
|
|
||||||
* Re-publish Assert previously published under NPM package @0xproject/0x-assert
|
* Re-publish Assert previously published under NPM package @0xproject/0x-assert
|
||||||
* Added assertion isValidBaseUnitAmount which checks both that the value is a valid bigNumber and that it does not contain decimals.
|
* Added assertion isValidBaseUnitAmount which checks both that the value is a valid bigNumber and that it does not contain decimals.
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@0xproject/assert",
|
"name": "@0xproject/assert",
|
||||||
"version": "0.0.11",
|
"version": "0.0.18",
|
||||||
"description": "Provides a standard way of performing type and schema validation across 0x projects",
|
"description": "Provides a standard way of performing type and schema validation across 0x projects",
|
||||||
"main": "lib/src/index.js",
|
"main": "lib/src/index.js",
|
||||||
"types": "lib/src/index.d.ts",
|
"types": "lib/src/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"build:watch": "tsc -w",
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"clean": "shx rm -rf _bundles lib test_temp",
|
"clean": "shx rm -rf _bundles lib test_temp",
|
||||||
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
|
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
|
||||||
@@ -23,22 +24,22 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x.js/packages/assert/README.md",
|
"homepage": "https://github.com/0xProject/0x.js/packages/assert/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0xproject/tslint-config": "^0.4.2",
|
"@0xproject/tslint-config": "^0.4.8",
|
||||||
"@types/lodash": "^4.14.86",
|
"@types/lodash": "^4.14.86",
|
||||||
"@types/mocha": "^2.2.42",
|
"@types/mocha": "^2.2.42",
|
||||||
"@types/valid-url": "^1.0.2",
|
"@types/valid-url": "^1.0.2",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-typescript-typings": "^0.0.2",
|
"chai-typescript-typings": "^0.0.3",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"mocha": "^4.0.1",
|
"mocha": "^4.0.1",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"tslint": "5.8.0",
|
"tslint": "5.8.0",
|
||||||
"typescript": "~2.6.1"
|
"typescript": "2.7.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0xproject/json-schemas": "^0.7.3",
|
"@0xproject/json-schemas": "^0.7.10",
|
||||||
"@0xproject/utils": "^0.2.0",
|
"@0xproject/utils": "^0.3.2",
|
||||||
"lodash": "^4.17.4",
|
"lodash": "^4.17.4",
|
||||||
"valid-url": "^1.0.9"
|
"valid-url": "^1.0.9"
|
||||||
}
|
}
|
||||||
|
@@ -2,14 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
|
|||||||
const packageJSON = require('../package.json');
|
const packageJSON = require('../package.json');
|
||||||
|
|
||||||
const subPackageName = packageJSON.name;
|
const subPackageName = packageJSON.name;
|
||||||
|
postpublish_utils.standardPostPublishAsync(subPackageName);
|
||||||
postpublish_utils
|
|
||||||
.getLatestTagAndVersionAsync(subPackageName)
|
|
||||||
.then(function(result) {
|
|
||||||
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
|
|
||||||
const assets = [];
|
|
||||||
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
|
|
||||||
})
|
|
||||||
.catch(function(err) {
|
|
||||||
throw err;
|
|
||||||
});
|
|
@@ -3,5 +3,10 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["./src/**/*", "./test/**/*", "../../node_modules/chai-typescript-typings/index.d.ts"]
|
"include": [
|
||||||
|
"./src/**/*",
|
||||||
|
"./test/**/*",
|
||||||
|
"../../node_modules/web3-typescript-typings/index.d.ts",
|
||||||
|
"../../node_modules/chai-typescript-typings/index.d.ts"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
3
packages/chai-as-promised-typescript-typings/.npmignore
Normal file
3
packages/chai-as-promised-typescript-typings/.npmignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.*
|
||||||
|
yarn-error.log
|
||||||
|
/scripts/
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "chai-as-promised-typescript-typings",
|
"name": "chai-as-promised-typescript-typings",
|
||||||
"version": "0.0.4",
|
"version": "0.0.9",
|
||||||
"description": "Typescript type definitions for chai-as-promised",
|
"description": "Typescript type definitions for chai-as-promised",
|
||||||
"main": "index.d.ts",
|
"main": "index.d.ts",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
@@ -9,13 +9,15 @@
|
|||||||
"url": "git+https://github.com/0xProject/0x.js.git"
|
"url": "git+https://github.com/0xProject/0x.js.git"
|
||||||
},
|
},
|
||||||
"author": "Fabio Berger",
|
"author": "Fabio Berger",
|
||||||
"contributors": ["Leonid Logvinov <logvinov.leon@gmail.com>"],
|
"contributors": [
|
||||||
|
"Leonid Logvinov <logvinov.leon@gmail.com>"
|
||||||
|
],
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/0xProject/0x.js/issues"
|
"url": "https://github.com/0xProject/0x.js/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x.js/packages/chai-as-promised-typescript-typings#readme",
|
"homepage": "https://github.com/0xProject/0x.js/packages/chai-as-promised-typescript-typings#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chai-typescript-typings": "^0.0.0"
|
"chai-typescript-typings": "^0.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,14 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
|
|||||||
const packageJSON = require('../package.json');
|
const packageJSON = require('../package.json');
|
||||||
|
|
||||||
const subPackageName = packageJSON.name;
|
const subPackageName = packageJSON.name;
|
||||||
|
postpublish_utils.standardPostPublishAsync(subPackageName);
|
||||||
postpublish_utils
|
|
||||||
.getLatestTagAndVersionAsync(subPackageName)
|
|
||||||
.then(function(result) {
|
|
||||||
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
|
|
||||||
const assets = [];
|
|
||||||
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
|
|
||||||
})
|
|
||||||
.catch(function(err) {
|
|
||||||
throw err;
|
|
||||||
});
|
|
3
packages/chai-typescript-typings/.npmignore
Normal file
3
packages/chai-typescript-typings/.npmignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.*
|
||||||
|
yarn-error.log
|
||||||
|
/scripts/
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "chai-typescript-typings",
|
"name": "chai-typescript-typings",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"description": "Typescript type definitions for chai",
|
"description": "Typescript type definitions for chai",
|
||||||
"main": "index.d.ts",
|
"main": "index.d.ts",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
|
@@ -2,14 +2,4 @@ const postpublish_utils = require('../../../scripts/postpublish_utils');
|
|||||||
const packageJSON = require('../package.json');
|
const packageJSON = require('../package.json');
|
||||||
|
|
||||||
const subPackageName = packageJSON.name;
|
const subPackageName = packageJSON.name;
|
||||||
|
postpublish_utils.standardPostPublishAsync(subPackageName);
|
||||||
postpublish_utils
|
|
||||||
.getLatestTagAndVersionAsync(subPackageName)
|
|
||||||
.then(function(result) {
|
|
||||||
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
|
|
||||||
const assets = [];
|
|
||||||
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
|
|
||||||
})
|
|
||||||
.catch(function(err) {
|
|
||||||
throw err;
|
|
||||||
});
|
|
7
packages/connect/.npmignore
Normal file
7
packages/connect/.npmignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.*
|
||||||
|
yarn-error.log
|
||||||
|
/src/
|
||||||
|
/scripts/
|
||||||
|
/generated_docs/
|
||||||
|
test/
|
||||||
|
tsconfig.json
|
@@ -1,5 +1,9 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## v0.5.7 - _February 9, 2018_
|
||||||
|
|
||||||
|
* Fix publishing issue where .npmignore was not properly excluding undesired content (#389)
|
||||||
|
|
||||||
## v0.5.0 - _January 17, 2018_
|
## v0.5.0 - _January 17, 2018_
|
||||||
|
|
||||||
* Sanitize api endpoint url and remove trailing slashes (#318)
|
* Sanitize api endpoint url and remove trailing slashes (#318)
|
||||||
|
@@ -1,16 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "@0xproject/connect",
|
"name": "@0xproject/connect",
|
||||||
"version": "0.5.0",
|
"version": "0.5.7",
|
||||||
"description": "A javascript library for interacting with the standard relayer api",
|
"description": "A javascript library for interacting with the standard relayer api",
|
||||||
"keywords": ["connect", "0xproject", "ethereum", "tokens", "exchange"],
|
"keywords": [
|
||||||
|
"connect",
|
||||||
|
"0xproject",
|
||||||
|
"ethereum",
|
||||||
|
"tokens",
|
||||||
|
"exchange"
|
||||||
|
],
|
||||||
"main": "lib/src/index.js",
|
"main": "lib/src/index.js",
|
||||||
"types": "lib/src/index.d.ts",
|
"types": "lib/src/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"build:watch": "tsc -w",
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"clean": "shx rm -rf _bundles lib test_temp",
|
"clean": "shx rm -rf _bundles lib test_temp",
|
||||||
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
|
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
|
||||||
"upload_docs_json":
|
"upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json",
|
||||||
"aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json",
|
|
||||||
"copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures",
|
"copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures",
|
||||||
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
|
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
|
||||||
"run_mocha": "mocha lib/test/**/*_test.js",
|
"run_mocha": "mocha lib/test/**/*_test.js",
|
||||||
@@ -31,16 +37,16 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x.js/packages/connect/README.md",
|
"homepage": "https://github.com/0xProject/0x.js/packages/connect/README.md",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0xproject/assert": "^0.0.11",
|
"@0xproject/assert": "^0.0.18",
|
||||||
"@0xproject/json-schemas": "^0.7.3",
|
"@0xproject/json-schemas": "^0.7.10",
|
||||||
"@0xproject/utils": "^0.2.0",
|
"@0xproject/utils": "^0.3.2",
|
||||||
"isomorphic-fetch": "^2.2.1",
|
"isomorphic-fetch": "^2.2.1",
|
||||||
"lodash": "^4.17.4",
|
"lodash": "^4.17.4",
|
||||||
"query-string": "^5.0.1",
|
"query-string": "^5.0.1",
|
||||||
"websocket": "^1.0.25"
|
"websocket": "^1.0.25"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0xproject/tslint-config": "^0.4.2",
|
"@0xproject/tslint-config": "^0.4.8",
|
||||||
"@types/fetch-mock": "^5.12.1",
|
"@types/fetch-mock": "^5.12.1",
|
||||||
"@types/lodash": "^4.14.86",
|
"@types/lodash": "^4.14.86",
|
||||||
"@types/mocha": "^2.2.42",
|
"@types/mocha": "^2.2.42",
|
||||||
@@ -48,8 +54,8 @@
|
|||||||
"@types/websocket": "^0.0.34",
|
"@types/websocket": "^0.0.34",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-as-promised-typescript-typings": "^0.0.4",
|
"chai-as-promised-typescript-typings": "^0.0.9",
|
||||||
"chai-typescript-typings": "^0.0.2",
|
"chai-typescript-typings": "^0.0.3",
|
||||||
"copyfiles": "^1.2.0",
|
"copyfiles": "^1.2.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"fetch-mock": "^5.13.1",
|
"fetch-mock": "^5.13.1",
|
||||||
@@ -58,7 +64,7 @@
|
|||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"tslint": "5.8.0",
|
"tslint": "5.8.0",
|
||||||
"typedoc": "~0.8.0",
|
"typedoc": "~0.8.0",
|
||||||
"typescript": "~2.6.1",
|
"typescript": "2.7.1",
|
||||||
"web3-typescript-typings": "^0.9.4"
|
"web3-typescript-typings": "^0.9.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"include": [
|
"include": [
|
||||||
"./src/**/*",
|
"./src/**/*",
|
||||||
"./test/**/*",
|
"./test/**/*",
|
||||||
|
"../../node_modules/web3-typescript-typings/index.d.ts",
|
||||||
"../../node_modules/chai-as-promised-typescript-typings/index.d.ts",
|
"../../node_modules/chai-as-promised-typescript-typings/index.d.ts",
|
||||||
"../../node_modules/chai-typescript-typings/index.d.ts"
|
"../../node_modules/chai-typescript-typings/index.d.ts"
|
||||||
]
|
]
|
||||||
|
@@ -38,6 +38,12 @@ yarn install
|
|||||||
yarn build
|
yarn build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn build:watch
|
||||||
|
```
|
||||||
|
|
||||||
### Clean
|
### Clean
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -1,394 +0,0 @@
|
|||||||
{
|
|
||||||
"contract_name": "EtherToken",
|
|
||||||
"abi": [
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "name",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "approve",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "totalSupply",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transferFrom",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "amount",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "withdraw",
|
|
||||||
"outputs": [],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "decimals",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint8"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "balanceOf",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "symbol",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transfer",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "deposit",
|
|
||||||
"outputs": [],
|
|
||||||
"payable": true,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "allowance",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"payable": true,
|
|
||||||
"type": "fallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unlinked_binary": "0x6060604052341561000c57fe5b5b6107598061001c6000396000f300606060405236156100935763ffffffff60e060020a60003504166306fdde0381146100a4578063095ea7b31461013457806318160ddd1461016757806323b872dd146101895780632e1a7d4d146101c2578063313ce567146101d757806370a08231146101fd57806395d89b411461022b578063a9059cbb146102bb578063d0e30db0146102ee578063dd62ed3e146102f8575b6100a25b61009f61032c565b5b565b005b34156100ac57fe5b6100b461037b565b6040805160208082528351818301528351919283929083019185019080838382156100fa575b8051825260208311156100fa57601f1990920191602091820191016100da565b505050905090810190601f1680156101265780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561013c57fe5b610153600160a060020a03600435166024356103a3565b604080519115158252519081900360200190f35b341561016f57fe5b61017761040e565b60408051918252519081900360200190f35b341561019157fe5b610153600160a060020a0360043581169060243516604435610414565b604080519115158252519081900360200190f35b34156101ca57fe5b6100a2600435610537565b005b34156101df57fe5b6101e76105b8565b6040805160ff9092168252519081900360200190f35b341561020557fe5b610177600160a060020a03600435166105bd565b60408051918252519081900360200190f35b341561023357fe5b6100b46105dc565b6040805160208082528351818301528351919283929083019185019080838382156100fa575b8051825260208311156100fa57601f1990920191602091820191016100da565b505050905090810190601f1680156101265780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102c357fe5b610153600160a060020a03600435166024356105fd565b604080519115158252519081900360200190f35b6100a261032c565b005b341561030057fe5b610177600160a060020a03600435811690602435166106af565b60408051918252519081900360200190f35b600160a060020a03331660009081526020819052604090205461034f90346106dc565b600160a060020a03331660009081526020819052604090205560025461037590346106dc565b6002555b565b60408051808201909152600b815260a960020a6a22ba3432b9102a37b5b2b702602082015281565b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60025481565b600160a060020a03808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104575750828110155b801561047d5750600160a060020a03841660009081526020819052604090205483810110155b1561052957600160a060020a03808516600090815260208190526040808220805487019055918716815220805484900390556000198110156104e757600160a060020a03808616600090815260016020908152604080832033909416835292905220805484900390555b83600160a060020a031685600160a060020a031660008051602061070e833981519152856040518082815260200191505060405180910390a36001915061052e565b600091505b5b509392505050565b600160a060020a03331660009081526020819052604090205461055a90826106f6565b600160a060020a03331660009081526020819052604090205560025461058090826106f6565b600255604051600160a060020a0333169082156108fc029083906000818181858888f1935050505015156105b45760006000fd5b5b50565b601281565b600160a060020a0381166000908152602081905260409020545b919050565b604080518082019091526004815260e360020a630ae8aa8902602082015281565b600160a060020a0333166000908152602081905260408120548290108015906106405750600160a060020a03831660009081526020819052604090205482810110155b156106a057600160a060020a03338116600081815260208181526040808320805488900390559387168083529184902080548701905583518681529351919360008051602061070e833981519152929081900390910190a3506001610408565b506000610408565b5b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b6000828201838110156106eb57fe5b8091505b5092915050565b60008282111561070257fe5b508082035b929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582036b62e75991ca24307fbb7333dc79a1493b9acb6b3e146e3c707708262cfbe430029",
|
|
||||||
"networks": {
|
|
||||||
"1": {
|
|
||||||
"links": {},
|
|
||||||
"events": {
|
|
||||||
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"updated_at": 1502488087000,
|
|
||||||
"address": "0x2956356cd2a2bf3202f771f50d3d14a367b48070"
|
|
||||||
},
|
|
||||||
"42": {
|
|
||||||
"links": {},
|
|
||||||
"events": {
|
|
||||||
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"updated_at": 1502391794392,
|
|
||||||
"address": "0x05d090b51c40b020eab3bfcb6a2dff130df22e9c"
|
|
||||||
},
|
|
||||||
"50": {
|
|
||||||
"links": {},
|
|
||||||
"events": {
|
|
||||||
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"updated_at": 1513088404209,
|
|
||||||
"address": "0x48bacb9266a570d521063ef5dd96e61686dbe788"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"schema_version": "0.0.5",
|
|
||||||
"updated_at": 1513088404209
|
|
||||||
}
|
|
File diff suppressed because one or more lines are too long
@@ -1,227 +0,0 @@
|
|||||||
{
|
|
||||||
"contract_name": "MaliciousToken",
|
|
||||||
"abi": [
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "approve",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "totalSupply",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transferFrom",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "balanceOf",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transfer",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "allowance",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unlinked_binary": "0x60606040526003805460ff19166001179055341561001957fe5b5b610467806100296000396000f3006060604052361561005c5763ffffffff60e060020a600035041663095ea7b3811461005e57806318160ddd1461009157806323b872dd146100b357806370a08231146100ec578063a9059cbb1461011a578063dd62ed3e1461014d575bfe5b341561006657fe5b61007d600160a060020a0360043516602435610181565b604080519115158252519081900360200190f35b341561009957fe5b6100a16101ec565b60408051918252519081900360200190f35b34156100bb57fe5b61007d600160a060020a03600435811690602435166044356101f2565b604080519115158252519081900360200190f35b34156100f457fe5b6100a1600160a060020a03600435166102ee565b60408051918252519081900360200190f35b341561012257fe5b61007d600160a060020a0360043516602435610318565b604080519115158252519081900360200190f35b341561015557fe5b6100a1600160a060020a03600435811690602435166103ca565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60025481565b600160a060020a0383166000908152602081905260408120548290108015906102425750600160a060020a0380851660009081526001602090815260408083203390941683529290522054829010155b80156102685750600160a060020a03831660009081526020819052604090205482810110155b156102e257600160a060020a03808416600081815260208181526040808320805488019055888516808452818420805489900390556001835281842033909616845294825291829020805487900390558151868152915192939260008051602061041c8339815191529281900390910190a35060016102e6565b5060005b5b9392505050565b60006102f8610402565b50600160a060020a0381166000908152602081905260409020545b919050565b600160a060020a03331660009081526020819052604081205482901080159061035b5750600160a060020a03831660009081526020819052604090205482810110155b156103bb57600160a060020a03338116600081815260208181526040808320805488900390559387168083529184902080548701905583518681529351919360008051602061041c833981519152929081900390910190a35060016101e6565b5060006101e6565b5b92915050565b60006103d4610402565b50600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b6003805460ff8082166001011660ff199091161790555b5600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582078edadabd342b34dc605a47ad9eab0ab5ad8513193a546e042b2ab9c6101d5250029",
|
|
||||||
"networks": {
|
|
||||||
"50": {
|
|
||||||
"links": {},
|
|
||||||
"events": {
|
|
||||||
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"updated_at": 1513088404210
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"schema_version": "0.0.5",
|
|
||||||
"updated_at": 1513088404210
|
|
||||||
}
|
|
@@ -1,72 +0,0 @@
|
|||||||
{
|
|
||||||
"contract_name": "Migrations",
|
|
||||||
"abi": [
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "new_address",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "upgrade",
|
|
||||||
"outputs": [],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "last_completed_migration",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "owner",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "completed",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "setCompleted",
|
|
||||||
"outputs": [],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"payable": false,
|
|
||||||
"type": "constructor"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unlinked_binary": "0x6060604052341561000c57fe5b5b60008054600160a060020a03191633600160a060020a03161790555b5b6101a0806100396000396000f300606060405263ffffffff60e060020a6000350416630900f0108114610042578063445df0ac146100605780638da5cb5b14610082578063fdacd576146100ae575bfe5b341561004a57fe5b61005e600160a060020a03600435166100c3565b005b341561006857fe5b61007061013d565b60408051918252519081900360200190f35b341561008a57fe5b610092610143565b60408051600160a060020a039092168252519081900360200190f35b34156100b657fe5b61005e600435610152565b005b6000805433600160a060020a03908116911614156101375781905080600160a060020a031663fdacd5766001546040518263ffffffff1660e060020a02815260040180828152602001915050600060405180830381600087803b151561012557fe5b6102c65a03f1151561013357fe5b5050505b5b5b5050565b60015481565b600054600160a060020a031681565b60005433600160a060020a039081169116141561016f5760018190555b5b5b505600a165627a7a72305820721709a2522264b5277c3048b17bea0e0f660776a386bacb5f36796ba40dac1c0029",
|
|
||||||
"networks": {
|
|
||||||
"50": {
|
|
||||||
"links": {},
|
|
||||||
"events": {},
|
|
||||||
"updated_at": 1513088404203
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"schema_version": "0.0.5",
|
|
||||||
"updated_at": 1513088404203
|
|
||||||
}
|
|
@@ -1,189 +0,0 @@
|
|||||||
{
|
|
||||||
"contract_name": "Mintable",
|
|
||||||
"abi": [
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "approve",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "totalSupply",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transferFrom",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "balanceOf",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "mint",
|
|
||||||
"outputs": [],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transfer",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "allowance",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unlinked_binary": "0x6060604052341561000c57fe5b5b6105018061001c6000396000f300606060405236156100675763ffffffff60e060020a600035041663095ea7b3811461006957806318160ddd1461009c57806323b872dd146100be57806370a08231146100f7578063a0712d6814610125578063a9059cbb1461013a578063dd62ed3e1461016d575bfe5b341561007157fe5b610088600160a060020a03600435166024356101a1565b604080519115158252519081900360200190f35b34156100a457fe5b6100ac61020c565b60408051918252519081900360200190f35b34156100c657fe5b610088600160a060020a0360043581169060243516604435610212565b604080519115158252519081900360200190f35b34156100ff57fe5b6100ac600160a060020a0360043516610335565b60408051918252519081900360200190f35b341561012d57fe5b610138600435610354565b005b341561014257fe5b610088600160a060020a03600435166024356103bc565b604080519115158252519081900360200190f35b341561017557fe5b6100ac600160a060020a036004358116906024351661046e565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60025481565b600160a060020a03808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906102555750828110155b801561027b5750600160a060020a03841660009081526020819052604090205483810110155b1561032757600160a060020a03808516600090815260208190526040808220805487019055918716815220805484900390556000198110156102e557600160a060020a03808616600090815260016020908152604080832033909416835292905220805484900390555b83600160a060020a031685600160a060020a03166000805160206104b6833981519152856040518082815260200191505060405180910390a36001915061032c565b600091505b5b509392505050565b600160a060020a0381166000908152602081905260409020545b919050565b68056bc75e2d6310000081111561036b5760006000fd5b600160a060020a03331660009081526020819052604090205461038f90829061049b565b600160a060020a0333166000908152602081905260409020556002546103b5908261049b565b6002555b50565b600160a060020a0333166000908152602081905260408120548290108015906103ff5750600160a060020a03831660009081526020819052604090205482810110155b1561045f57600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191936000805160206104b6833981519152929081900390910190a3506001610206565b506000610206565b5b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b6000828201838110156104aa57fe5b8091505b50929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820b1c955ed24ff28cfa482298867cac2a83e25903b0100a429152919223fdf653f0029",
|
|
||||||
"networks": {},
|
|
||||||
"schema_version": "0.0.5",
|
|
||||||
"updated_at": 1513088402049
|
|
||||||
}
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"contract_name": "Ownable",
|
|
||||||
"abi": [
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "owner",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "newOwner",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transferOwnership",
|
|
||||||
"outputs": [],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"payable": false,
|
|
||||||
"type": "constructor"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unlinked_binary": "0x6060604052341561000c57fe5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60f3806100386000396000f300606060405263ffffffff60e060020a6000350416638da5cb5b8114602a578063f2fde38b146053575bfe5b3415603157fe5b6037606e565b60408051600160a060020a039092168252519081900360200190f35b3415605a57fe5b606c600160a060020a0360043516607d565b005b600054600160a060020a031681565b60005433600160a060020a0390811691161460985760006000fd5b600160a060020a0381161560c25760008054600160a060020a031916600160a060020a0383161790555b5b5b505600a165627a7a7230582048ccfb6ebb285c80c8b4030a0e4f2e6ec2a0619b363a2d7cd20692a0cfb170550029",
|
|
||||||
"networks": {},
|
|
||||||
"schema_version": "0.0.5",
|
|
||||||
"updated_at": 1513088402049
|
|
||||||
}
|
|
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"contract_name": "SafeMath",
|
|
||||||
"abi": [],
|
|
||||||
"unlinked_binary": "0x60606040523415600b57fe5b5b60338060196000396000f30060606040525bfe00a165627a7a72305820becdc80300a4dbf834bb9ab115616eb459f82b51a9133d360eb1e6e5402072eb0029",
|
|
||||||
"networks": {},
|
|
||||||
"schema_version": "0.0.5",
|
|
||||||
"updated_at": 1513088402049
|
|
||||||
}
|
|
@@ -1,176 +0,0 @@
|
|||||||
{
|
|
||||||
"contract_name": "StandardToken",
|
|
||||||
"abi": [
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "approve",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "totalSupply",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transferFrom",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "balanceOf",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transfer",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "allowance",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unlinked_binary": "0x6060604052341561000c57fe5b5b6104388061001c6000396000f3006060604052361561005c5763ffffffff60e060020a600035041663095ea7b3811461005e57806318160ddd1461009157806323b872dd146100b357806370a08231146100ec578063a9059cbb1461011a578063dd62ed3e1461014d575bfe5b341561006657fe5b61007d600160a060020a0360043516602435610181565b604080519115158252519081900360200190f35b341561009957fe5b6100a16101ec565b60408051918252519081900360200190f35b34156100bb57fe5b61007d600160a060020a03600435811690602435166044356101f2565b604080519115158252519081900360200190f35b34156100f457fe5b6100a1600160a060020a03600435166102ee565b60408051918252519081900360200190f35b341561012257fe5b61007d600160a060020a036004351660243561030d565b604080519115158252519081900360200190f35b341561015557fe5b6100a1600160a060020a03600435811690602435166103bf565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60025481565b600160a060020a0383166000908152602081905260408120548290108015906102425750600160a060020a0380851660009081526001602090815260408083203390941683529290522054829010155b80156102685750600160a060020a03831660009081526020819052604090205482810110155b156102e257600160a060020a0380841660008181526020818152604080832080548801905588851680845281842080548990039055600183528184203390961684529482529182902080548790039055815186815291519293926000805160206103ed8339815191529281900390910190a35060016102e6565b5060005b5b9392505050565b600160a060020a0381166000908152602081905260409020545b919050565b600160a060020a0333166000908152602081905260408120548290108015906103505750600160a060020a03831660009081526020819052604090205482810110155b156103b057600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191936000805160206103ed833981519152929081900390910190a35060016101e6565b5060006101e6565b5b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582056d411baf4691cc9a0a55ffa6b4a4e9308ea12187fd2fa738228bbd266709d4d0029",
|
|
||||||
"networks": {},
|
|
||||||
"schema_version": "0.0.5",
|
|
||||||
"updated_at": 1513088402049
|
|
||||||
}
|
|
@@ -1,176 +0,0 @@
|
|||||||
{
|
|
||||||
"contract_name": "Token",
|
|
||||||
"abi": [
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "approve",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "success",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "totalSupply",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "supply",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transferFrom",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "success",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "balanceOf",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "balance",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transfer",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "success",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "allowance",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "remaining",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unlinked_binary": "0x6060604052341561000c57fe5b5b6101e08061001c6000396000f3006060604052361561005c5763ffffffff60e060020a600035041663095ea7b3811461005e57806318160ddd1461009157806323b872dd146100b357806370a08231146100ec578063a9059cbb1461005e578063dd62ed3e1461014d575bfe5b341561006657fe5b61007d600160a060020a0360043516602435610181565b604080519115158252519081900360200190f35b341561009957fe5b6100a161018a565b60408051918252519081900360200190f35b34156100bb57fe5b61007d600160a060020a0360043581169060243516604435610190565b604080519115158252519081900360200190f35b34156100f457fe5b6100a1600160a060020a036004351661019a565b60408051918252519081900360200190f35b341561006657fe5b61007d600160a060020a0360043516602435610181565b604080519115158252519081900360200190f35b341561015557fe5b6100a1600160a060020a0360043581169060243516610181565b60408051918252519081900360200190f35b60005b92915050565b60005b90565b60005b9392505050565b60005b919050565b60005b92915050565b60005b929150505600a165627a7a72305820107c1e9e7aa669d21343c42639b4bb080602c349d00c1da14b8ea6b6dcc0b0f80029",
|
|
||||||
"networks": {},
|
|
||||||
"schema_version": "0.0.5",
|
|
||||||
"updated_at": 1513088402049
|
|
||||||
}
|
|
File diff suppressed because one or more lines are too long
@@ -1,298 +0,0 @@
|
|||||||
{
|
|
||||||
"contract_name": "TokenTransferProxy",
|
|
||||||
"abi": [
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "token",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transferFrom",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "target",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "addAuthorizedAddress",
|
|
||||||
"outputs": [],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "authorities",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "target",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "removeAuthorizedAddress",
|
|
||||||
"outputs": [],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "owner",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "authorized",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "getAuthorizedAddresses",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "address[]"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "newOwner",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transferOwnership",
|
|
||||||
"outputs": [],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "target",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "caller",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "LogAuthorizedAddressAdded",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "target",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "caller",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "LogAuthorizedAddressRemoved",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unlinked_binary": "0x60606040525b60008054600160a060020a03191633600160a060020a03161790555b5b6106e6806100316000396000f300606060405236156100725763ffffffff60e060020a60003504166315dacbea811461007457806342f1181e146100b3578063494503d4146100d157806370712939146101005780638da5cb5b1461011e578063b91816111461014a578063d39de6e91461017a578063f2fde38b146101e5575bfe5b341561007c57fe5b61009f600160a060020a0360043581169060243581169060443516606435610203565b604080519115158252519081900360200190f35b34156100bb57fe5b6100cf600160a060020a03600435166102ae565b005b34156100d957fe5b6100e4600435610390565b60408051600160a060020a039092168252519081900360200190f35b341561010857fe5b6100cf600160a060020a03600435166103c2565b005b341561012657fe5b6100e461055a565b60408051600160a060020a039092168252519081900360200190f35b341561015257fe5b61009f600160a060020a0360043516610569565b604080519115158252519081900360200190f35b341561018257fe5b61018a61057e565b60408051602080825283518183015283519192839290830191858101910280838382156101d2575b8051825260208311156101d257601f1990920191602091820191016101b2565b5050509050019250505060405180910390f35b34156101ed57fe5b6100cf600160a060020a03600435166105e7565b005b600160a060020a03331660009081526001602052604081205460ff16151561022b5760006000fd5b6040805160006020918201819052825160e060020a6323b872dd028152600160a060020a0388811660048301528781166024830152604482018790529351938916936323b872dd9360648084019491938390030190829087803b151561028d57fe5b6102c65a03f1151561029b57fe5b5050604051519150505b5b949350505050565b60005433600160a060020a039081169116146102ca5760006000fd5b600160a060020a038116600090815260016020526040902054819060ff16156102f35760006000fd5b600160a060020a0382166000908152600160208190526040909120805460ff191682179055600280549091810161032a8382610633565b916000526020600020900160005b81546101009190910a600160a060020a0381810219909216868316918202179092556040513390911692507f94bb87f4c15c4587ff559a7584006fa01ddf9299359be6b512b94527aa961aca90600090a35b5b505b50565b600280548290811061039e57fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b6000805433600160a060020a039081169116146103df5760006000fd5b600160a060020a038216600090815260016020526040902054829060ff1615156104095760006000fd5b600160a060020a0383166000908152600160205260408120805460ff1916905591505b6002548210156105195782600160a060020a031660028381548110151561044f57fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a0316141561050d5760028054600019810190811061049057fe5b906000526020600020900160005b9054906101000a9004600160a060020a03166002838154811015156104bf57fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a0316021790555060016002818180549050039150816105079190610633565b50610519565b5b60019091019061042c565b604051600160a060020a0333811691908516907ff5b347a1e40749dd050f5f07fbdbeb7e3efa9756903044dd29401fd1d4bb4a1c90600090a35b5b505b5050565b600054600160a060020a031681565b60016020526000908152604090205460ff1681565b610586610687565b60028054806020026020016040519081016040528092919081815260200182805480156105dc57602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116105be575b505050505090505b90565b60005433600160a060020a039081169116146106035760006000fd5b600160a060020a0381161561038d5760008054600160a060020a031916600160a060020a0383161790555b5b5b50565b81548183558181151161055357600083815260209020610553918101908301610699565b5b505050565b81548183558181151161055357600083815260209020610553918101908301610699565b5b505050565b60408051602081019091526000815290565b6105e491905b808211156106b3576000815560010161069f565b5090565b905600a165627a7a72305820f53c9547789a008ccb8f24999a7b6fb4c8fb20655522030c87ba624e1fdb67ea0029",
|
|
||||||
"networks": {
|
|
||||||
"1": {
|
|
||||||
"links": {},
|
|
||||||
"events": {
|
|
||||||
"0x94bb87f4c15c4587ff559a7584006fa01ddf9299359be6b512b94527aa961aca": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "target",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "caller",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "LogAuthorizedAddressAdded",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
"0xf5b347a1e40749dd050f5f07fbdbeb7e3efa9756903044dd29401fd1d4bb4a1c": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "target",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "caller",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "LogAuthorizedAddressRemoved",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"updated_at": 1502478966000,
|
|
||||||
"address": "0x8da0d80f5007ef1e431dd2127178d224e32c2ef4"
|
|
||||||
},
|
|
||||||
"42": {
|
|
||||||
"links": {},
|
|
||||||
"events": {
|
|
||||||
"0x94bb87f4c15c4587ff559a7584006fa01ddf9299359be6b512b94527aa961aca": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "target",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "caller",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "LogAuthorizedAddressAdded",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
"0xf5b347a1e40749dd050f5f07fbdbeb7e3efa9756903044dd29401fd1d4bb4a1c": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "target",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "caller",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "LogAuthorizedAddressRemoved",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"updated_at": 1502391794384,
|
|
||||||
"address": "0x087Eed4Bc1ee3DE49BeFbd66C662B434B15d49d4"
|
|
||||||
},
|
|
||||||
"50": {
|
|
||||||
"links": {},
|
|
||||||
"events": {
|
|
||||||
"0x94bb87f4c15c4587ff559a7584006fa01ddf9299359be6b512b94527aa961aca": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "target",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "caller",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "LogAuthorizedAddressAdded",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
"0xf5b347a1e40749dd050f5f07fbdbeb7e3efa9756903044dd29401fd1d4bb4a1c": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "target",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "caller",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "LogAuthorizedAddressRemoved",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"updated_at": 1513088404202,
|
|
||||||
"address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"schema_version": "0.0.5",
|
|
||||||
"updated_at": 1513088404202
|
|
||||||
}
|
|
@@ -1,373 +0,0 @@
|
|||||||
{
|
|
||||||
"contract_name": "ZRXToken",
|
|
||||||
"abi": [
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "name",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "approve",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "totalSupply",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transferFrom",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "decimals",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint8"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "balanceOf",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [],
|
|
||||||
"name": "symbol",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transfer",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"constant": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "allowance",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payable": false,
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"payable": false,
|
|
||||||
"type": "constructor"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unlinked_binary": "0x60606040526b033b2e3c9fd0803ce8000000600355341561001c57fe5b5b600354600160a060020a0333166000908152602081905260409020555b5b6106198061004a6000396000f3006060604052361561007d5763ffffffff60e060020a60003504166306fdde03811461007f578063095ea7b31461010f57806318160ddd1461014257806323b872dd14610164578063313ce5671461019d57806370a08231146101c357806395d89b41146101f1578063a9059cbb14610281578063dd62ed3e146102b4575bfe5b341561008757fe5b61008f6102e8565b6040805160208082528351818301528351919283929083019185019080838382156100d5575b8051825260208311156100d557601f1990920191602091820191016100b5565b505050905090810190601f1680156101015780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561011757fe5b61012e600160a060020a0360043516602435610316565b604080519115158252519081900360200190f35b341561014a57fe5b610152610381565b60408051918252519081900360200190f35b341561016c57fe5b61012e600160a060020a0360043581169060243516604435610387565b604080519115158252519081900360200190f35b34156101a557fe5b6101ad6104aa565b6040805160ff9092168252519081900360200190f35b34156101cb57fe5b610152600160a060020a03600435166104af565b60408051918252519081900360200190f35b34156101f957fe5b61008f6104ce565b6040805160208082528351818301528351919283929083019185019080838382156100d5575b8051825260208311156100d557601f1990920191602091820191016100b5565b505050905090810190601f1680156101015780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561028957fe5b61012e600160a060020a03600435166024356104ee565b604080519115158252519081900360200190f35b34156102bc57fe5b610152600160a060020a03600435811690602435166105a0565b60408051918252519081900360200190f35b6040805180820190915260118152607960020a70183c10283937ba37b1b7b6102a37b5b2b702602082015281565b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b600160a060020a03808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906103ca5750828110155b80156103f05750600160a060020a03841660009081526020819052604090205483810110155b1561049c57600160a060020a038085166000908152602081905260408082208054870190559187168152208054849003905560001981101561045a57600160a060020a03808616600090815260016020908152604080832033909416835292905220805484900390555b83600160a060020a031685600160a060020a03166000805160206105ce833981519152856040518082815260200191505060405180910390a3600191506104a1565b600091505b5b509392505050565b601281565b600160a060020a0381166000908152602081905260409020545b919050565b604080518082019091526003815260eb60020a620b4a4b02602082015281565b600160a060020a0333166000908152602081905260408120548290108015906105315750600160a060020a03831660009081526020819052604090205482810110155b1561059157600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191936000805160206105ce833981519152929081900390910190a350600161037b565b50600061037b565b5b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058206964b3cfca2af9b1d1448e45eb8b04a5c1df55275a172242166d69e576e2a3b70029",
|
|
||||||
"networks": {
|
|
||||||
"1": {
|
|
||||||
"links": {},
|
|
||||||
"events": {
|
|
||||||
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"updated_at": 1502477311000,
|
|
||||||
"address": "0xe41d2489571d322189246dafa5ebde1f4699f498"
|
|
||||||
},
|
|
||||||
"42": {
|
|
||||||
"links": {},
|
|
||||||
"events": {
|
|
||||||
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"updated_at": 1502391794391,
|
|
||||||
"address": "0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570"
|
|
||||||
},
|
|
||||||
"50": {
|
|
||||||
"links": {},
|
|
||||||
"events": {
|
|
||||||
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Transfer",
|
|
||||||
"type": "event"
|
|
||||||
},
|
|
||||||
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": {
|
|
||||||
"anonymous": false,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_owner",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"name": "_spender",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"name": "_value",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "Approval",
|
|
||||||
"type": "event"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"updated_at": 1513088404207
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"schema_version": "0.0.5",
|
|
||||||
"updated_at": 1513088404207
|
|
||||||
}
|
|
@@ -2,6 +2,7 @@
|
|||||||
* This file is auto-generated using abi-gen. Don't edit directly.
|
* This file is auto-generated using abi-gen. Don't edit directly.
|
||||||
* Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates.
|
* Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates.
|
||||||
*/
|
*/
|
||||||
|
// tslint:disable:async-suffix member-ordering no-consecutive-blank-lines
|
||||||
// tslint:disable-next-line:no-unused-variable
|
// tslint:disable-next-line:no-unused-variable
|
||||||
import { TxData, TxDataPayable } from '@0xproject/types';
|
import { TxData, TxDataPayable } from '@0xproject/types';
|
||||||
import { BigNumber, classUtils, promisify } from '@0xproject/utils';
|
import { BigNumber, classUtils, promisify } from '@0xproject/utils';
|
||||||
@@ -18,8 +19,8 @@ export class {{contractName}}Contract extends BaseContract {
|
|||||||
{{> tx contractName=../contractName}}
|
{{> tx contractName=../contractName}}
|
||||||
{{/this.constant}}
|
{{/this.constant}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) {
|
constructor(web3ContractInstance: Web3.ContractInstance, defaults?: Partial<TxData>) {
|
||||||
super(web3ContractInstance, defaults);
|
super(web3ContractInstance, defaults);
|
||||||
classUtils.bindAll(this, ['web3ContractInstance', 'defaults']);
|
classUtils.bindAll(this, ['_web3ContractInstance', '_defaults']);
|
||||||
}
|
}
|
||||||
} // tslint:disable:max-file-line-count
|
} // tslint:disable:max-file-line-count
|
@@ -0,0 +1,10 @@
|
|||||||
|
public async {{this.name}}(
|
||||||
|
{{> typed_params inputs=inputs}}
|
||||||
|
defaultBlock?: Web3.BlockParam,
|
||||||
|
): Promise<{{> return_type outputs=outputs}}> {
|
||||||
|
const self = this as {{contractName}}Contract;
|
||||||
|
const result = await self._web3ContractInstance.{{this.name}}.call(
|
||||||
|
{{> params inputs=inputs}}
|
||||||
|
);
|
||||||
|
return result;
|
||||||
|
}
|
@@ -0,0 +1,3 @@
|
|||||||
|
{{#each inputs}}
|
||||||
|
{{name}},
|
||||||
|
{{/each}}
|
@@ -0,0 +1,10 @@
|
|||||||
|
{{#if outputs.length}}
|
||||||
|
{{#singleReturnValue}}
|
||||||
|
{{#returnType outputs.0.type}}{{/returnType}}
|
||||||
|
{{/singleReturnValue}}
|
||||||
|
{{^singleReturnValue}}
|
||||||
|
[{{#each outputs}}{{#returnType type}}{{/returnType}}{{#unless @last}}, {{/unless}}{{/each}}]
|
||||||
|
{{/singleReturnValue}}
|
||||||
|
{{else}}
|
||||||
|
void
|
||||||
|
{{/if}}
|
36
packages/contracts/contract_templates/partials/tx.handlebars
Normal file
36
packages/contracts/contract_templates/partials/tx.handlebars
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
public {{this.name}} = {
|
||||||
|
async sendTransactionAsync(
|
||||||
|
{{> typed_params inputs=inputs}}
|
||||||
|
{{#this.payable}}
|
||||||
|
txData: TxDataPayable = {},
|
||||||
|
{{/this.payable}}
|
||||||
|
{{^this.payable}}
|
||||||
|
txData: TxData = {},
|
||||||
|
{{/this.payable}}
|
||||||
|
): Promise<string> {
|
||||||
|
const self = this as {{contractName}}Contract;
|
||||||
|
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(txData);
|
||||||
|
const txHash = await self._web3ContractInstance.{{this.name}}(
|
||||||
|
{{> params inputs=inputs}}
|
||||||
|
txDataWithDefaults,
|
||||||
|
);
|
||||||
|
return txHash;
|
||||||
|
},
|
||||||
|
async callAsync(
|
||||||
|
{{> typed_params inputs=inputs}}
|
||||||
|
{{#this.payable}}
|
||||||
|
txData: TxDataPayable = {},
|
||||||
|
{{/this.payable}}
|
||||||
|
{{^this.payable}}
|
||||||
|
txData: TxData = {},
|
||||||
|
{{/this.payable}}
|
||||||
|
): Promise<{{> return_type outputs=outputs}}> {
|
||||||
|
const self = this as {{contractName}}Contract;
|
||||||
|
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(txData);
|
||||||
|
const returnValue = await self._web3ContractInstance.{{this.name}}.call(
|
||||||
|
{{> params inputs=inputs}}
|
||||||
|
txDataWithDefaults,
|
||||||
|
);
|
||||||
|
return returnValue;
|
||||||
|
},
|
||||||
|
};
|
@@ -0,0 +1,3 @@
|
|||||||
|
{{#each inputs}}
|
||||||
|
{{name}}: {{#parameterType type}}{{/parameterType}},
|
||||||
|
{{/each}}
|
@@ -1,38 +0,0 @@
|
|||||||
pragma solidity 0.4.18;
|
|
||||||
|
|
||||||
import "./Mintable_v2.sol";
|
|
||||||
import "./../utils/Ownable_v2.sol";
|
|
||||||
|
|
||||||
contract DummyToken_v2 is Mintable_v2, Ownable_v2 {
|
|
||||||
string public name;
|
|
||||||
string public symbol;
|
|
||||||
uint public decimals;
|
|
||||||
|
|
||||||
function DummyToken_v2(
|
|
||||||
string _name,
|
|
||||||
string _symbol,
|
|
||||||
uint _decimals,
|
|
||||||
uint _totalSupply)
|
|
||||||
public
|
|
||||||
{
|
|
||||||
name = _name;
|
|
||||||
symbol = _symbol;
|
|
||||||
decimals = _decimals;
|
|
||||||
totalSupply = _totalSupply;
|
|
||||||
balances[msg.sender] = _totalSupply;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setBalance(address _target, uint _value)
|
|
||||||
public
|
|
||||||
onlyOwner
|
|
||||||
{
|
|
||||||
uint currBalance = balanceOf(_target);
|
|
||||||
if (_value < currBalance) {
|
|
||||||
totalSupply = safeSub(totalSupply, safeSub(currBalance, _value));
|
|
||||||
} else {
|
|
||||||
totalSupply = safeAdd(totalSupply, safeSub(_value, currBalance));
|
|
||||||
}
|
|
||||||
balances[_target] = _value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user