12879 Commits

Author SHA1 Message Date
Xianny
50da1354f3
Move CLI tests for abi-gen (#1930)
Closes #1925, #1926
2019-07-10 09:19:50 -07:00
Francesco Agosti
e503cacf57
Merge pull request #1916 from 0xProject/feature/website/add-theo
Adding Theo to team page
2019-07-08 13:57:36 -07:00
Fabio B
6a1e0edc78
Fix link to smart contracts 2019-07-08 21:45:40 +02:00
Xianny
048f5c2771
[Multilang] hardcode ABI into abi-gen-wrappers (#1883)
* Export artifacts and addresses from abi-gen-wrappers

* only export addresses, not artifacts

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

ABI is now hardcoded when wrapper is generated

* remove unused imports

* remove unused import

* changes after review

* fix method ordering

* update constructor args

* prettier

* statically enumerate ABI properties

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

* add template for recursive components

* add `indexed` field for EventParameter

* prettier

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

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

* .circleci: give cache more descriptive name

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

* contract-artifacts: add devdoc to ERC20Token.json

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

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

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

* abi-gen: Python!

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

* existing erc20 python wrapper: re-order methods

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

* existing erc20 python wrapper: rename method

Rename method _erc20 to _get_contract_instance.

* existing erc20 python wrapper: rename vars

Rename method parameters to match names used in contract methods.

* existing erc20 python wrapper: correction

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

* contract_wrappers.py: pull in generated code

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

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

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

* abi-gen: sanitize docstrings for pycodestyle lint

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

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

Also, expose ABI as a static method.

* py wrappers: contract addr to ctor, not methods

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

* py wrappers: remove unused param `account_address`

* py wrappers: document use of `private_key`

* Rename file erc20_wrapper.py to erc20_token.py

To match the name of the underlying contract.

* Update CHANGELOG.json's

* git rm erc20_token.py

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

* abi-gen-templates: tweak CHANGELOG wording

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

* Include transaction parameters in const calls too

* Doc contract_address param to gen'd wrapper ctor

* make myself a CODEOWNER of abi-gen*

* rename ids: langLocalName -> languageSpecificName

* Move Python generation to its own packages/ folder

* Stop duplicating contract artifacts in Python pkg!

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

* move py templates BACK to abi-gen-templates

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

* Update known-good test output: prettify

* add getABIEncodedTransationData to gen'd code

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

f51c4f9617

* Fix missed instance of languageSpecificName change

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

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

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

- sol-compile test fixture contracts in every test run

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

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

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

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

These outstanding problems are currently causing this test to fail.

* fix failing abi-gen test: missing return types

* fix failing abi-gen test: qualify imports

* in py wrapper, simplify base class initialization

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

* move 3rd party typings to typescript-typings

* make package python-contract-wrappers private

* make Xianny CODEOWNER of base-contract & templates

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

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

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

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

* remove pipeline everywhere

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

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

This PR makes the following changes to `contract-artifacts`:
- remove `evm.bytecode.linkReferences` from all artifacts
- remove `evm.deployedBytecode` and `sourceTreeHashHex` from Coordinator artifact
- prettify all artifacts (whitespace only changes)
2019-06-17 11:00:53 -07:00
Fabio B
2672a5c59f
Merge pull request #1867 from 0xProject/fix/trezorSubprovider
Fix bug in Trezor implementation
2019-06-17 10:18:37 -07:00
Rick Morty
5f383430eb Add CHANGELOG entry 2019-06-15 21:27:09 -07:00
Rick Morty
66ec3e9f4d Hex should be true since the data returned expects it to be hex encoded 2019-06-15 21:23:40 -07:00
Fabio B
c269c427a6
Merge pull request #1865 from 0xProject/feature/ethBalanceChecker
contracts/dev-utils: Add EthBalanceChecker contract to monorepo
2019-06-13 09:37:40 -07:00
Fabio Berger
212855ebd8 Add missing import 2019-06-12 09:29:19 -07:00
Fabio Berger
8f78945a73 Update Python artifact 2019-06-12 09:15:40 -07:00