50 Commits

Author SHA1 Message Date
Lawrence Forman
651e94bd94 @0x/asset-proxy: Add more functions to IDydx.
`@0x/dev-utils`: Fix all the weird dydx base unit madness.
2020-02-19 15:45:27 -05:00
Lawrence Forman
162b6f1a74 @0x/dev-utils: Fix dydx min CR not being +1.
`@0x/dev-utils`: Fix withdraw rate vs order conversion rate check .
2020-02-19 15:45:27 -05:00
Lawrence Forman
865a253eb5 @0x/contracts-utils: Roll back additions to LibFractions.
`@0x/contracts-dev-utils`: Add `D18` library for working with base-10, 18-digit decimals.
`@0x/contracts-dev-utils`: Use `D18` library instead of `LibFractions` in `LibDydxBalance`.
2020-02-19 15:45:27 -05:00
Lawrence Forman
9b3781abf1 Cherry pick dydx validation from #2456 2020-02-19 15:45:27 -05:00
Alex Towle
ae151df2eb Addressed amir's review feedback 2020-02-13 18:07:45 -08:00
Alex Towle
f53606007d Updated DevUtils again 2020-02-13 17:37:03 -08:00
Lawrence Forman
4016808fa4 Cherry pick DevUtils refactor code from #2456 2020-02-07 23:23:23 -05:00
Lawrence Forman
3e8f9a6b53 Cherry-pick changes from feat/dev-utils/dydx-bridge-validation 2020-02-07 22:10:10 -05:00
James Towle
ce04d3ce41 Fix regression in DevUtils (#2449)
* fix bug in OrderTransferSimulationUtils causing failures for 721 assets

* Patched the regression and added tests

* Added regression test for fillable order

* Created a test for in and out of process ganache

* Split up DevUtils into two contracts

* Updated migration

* Remove the in and out of process ganache test

* Fixed contract addresses

* Appease linter

* Addressed review comments and updated artifacts, wrappers, and snapshots

* Fixed regression after refactor

* Update DevUtils and libTransactionDecoder contracts on mainnet and testnets

* Addressed @mzhu's review feedback

* Addressed @hysz's review feedback

* Updated devUtils address on testnets and mainnet after deployment

Co-authored-by: mzhu25 <mchl.zhu.96@gmail.com>
Co-authored-by: Fabio B <kandinsky454@protonmail.ch>
2020-01-22 12:54:10 +10:00
Amir
5dd3b8cf9d Special case unlimited allowance for Chai 2020-01-17 09:59:03 -08:00
Amir
e834fa0050 Split Dai calculation and erc20 balance checks into separate functions 2020-01-17 09:59:03 -08:00
Amir
9a97401606 Add ChaiBridge allowance checks 2020-01-17 09:59:03 -08:00
Amir
410a3fef18 Add ChaiBridge balance checks to DevUtils 2020-01-17 09:59:03 -08:00
Michael Zhu
1dca378e03 add division-by-zero check for ERC1155 too 2020-01-14 16:32:18 -08:00
Michael Zhu
d591b3dd98 LibAssetData fixes 2020-01-13 14:10:55 -08:00
Alex Towle
b979196ffd Remove the taker patch 2019-12-17 19:02:57 -08:00
Alex Towle
2949db5f49 Fixed the bug and added tests that fail without the patch 2019-12-17 19:02:57 -08:00
Alex Towle
47c3ed9705 Fixed the bug and moved "contracts-tests" to "contracts-integrations" 2019-12-17 19:02:57 -08:00
F. Eugene Aumson
f11d8a5bd8
@0x/order-utils refactors for v3: orderParsingUtils, signatureUtils, orderHashUtils, RevertErrors, transactionHashUtils (#2321)
* move orderParsingUtils from order-utils to connect

* Remove many functions from signatureUtils

Removed from the exported object, that is.  All of them are used in
other existing code, so they were all moved to be as local to their
usage as possible.

* remove orderHashUtils.isValidOrderHash()

* Move all *RevertErrors from order-utils...

...into their respective @0x/contracts- packages.

* Refactor @0x/order-utils' orderHashUtils away

- Move existing routines into @0x/contracts-test-utils

- Migrate non-contract-test callers to a newly-exposed getOrderHash()
method in DevUtils.

* Move all *RevertErrors from @0x/utils...

...into their respective @0x/contracts- packages.

* rm transactionHashUtils.isValidTransactionHash()

* DevUtils.sol: Fail yarn test if too big to deploy

* Refactor @0x/order-utils transactionHashUtils away

- Move existing routines into @0x/contracts-test-utils

- Migrate non-contract-test callers to a newly-exposed
getTransactionHash() method in DevUtils.

* Consolidate `Removed export...` CHANGELOG entries

* Rm EthBalanceChecker from devutils wrapper exports

* Stop importing from '.' or '.../src'

* fix builds

* fix prettier; dangling promise

* increase max bundle size
2019-11-14 17:14:24 -05:00
Xianny
6a852ab0ed
Replace assetDataUtils with DevUtilsContract wherever possible (#2304)
* Replace assetDataUtils with DevUtilsContract wherever possible

Does not replace from @0x/instant and some @0x/order-utils uses

* Add revertIfInvalidAssetData to LibAssetData

This is needed to replace `assetDataUtils.decodeAssetDataOrThrow`.
Because it's used in packages and not only contracts, we should wait
to deploy the updated contract so we can update `@0x/contract-artifacts`,
`@0x/abi-gen-wrappers`, and `@0x/contract-wrappers` first.

* remove usages of signatureUtils

* fix test for  optimised encoding

* refactor @0x/contracts-integrations

* update changelogs

* Move @0x/contracts-dev-utils from devDependencies to dependencies
It is exported as part of the package
2019-11-06 19:40:20 -08:00
F. Eugene Aumson
c051e11a49
OrderValidationUtils: don't parse fee asset data when there are no fees specified (#2218)
* exhibit bug: empty fee asset data induces revert

* fix bug: don't parse fee asset data unless fee>0

* Update DevUtils Kovan contract address
2019-09-30 17:53:21 -04:00
F. Eugene Aumson
bca8c5eccc
DevUtils.sol: Upgrade for v3 (#2161)
* Exhibit bug in getSimulatedOrderTransferResults

* Fix getSimulatedOrderTransferResults

* dev-utils/package.json: add quantify_bytecode cmd

* Fix typo in log message

* Reduce compiler optimization runs

In order to reduce the EVM bytecode object length of the DevUtils
contract to be under the EIP-170 limit of 24 KB.
2019-09-18 19:36:06 -04:00
Amir Bandeali
cb8cf1f107 Add back batchFillOrders 2019-09-03 11:06:45 -07:00
Amir Bandeali
18b65a61ff Fix build 2019-09-01 19:14:16 -07:00
Lawrence Forman
89f1d54ebc @0x/contracts-dev-utils: Add marketBuy/SellOrdersNoThrow and marketBuy/SellOrdersFillOrKill to LibTransactionDecoder. 2019-08-21 10:59:34 -04:00
Amir Bandeali
c366a4bd83 Update copyright dates 2019-08-20 12:49:01 -07:00
Amir Bandeali
dc31294440 Move LibExchangeRichErrors to exchange-libs package 2019-08-13 16:20:35 -07:00
Amir Bandeali
2e519b534d Fix build in OrderValidationUtils 2019-08-13 16:11:09 -07:00
Amir Bandeali
58ee4447a1 Remove remaining hard coded selectors 2019-08-13 16:04:33 -07:00
Amir Bandeali
2e97cfa5e5 Remove LibAssetProxyIds and TestLibConstants 2019-08-13 16:04:33 -07:00
Amir Bandeali
7d5276ad11 Remove LibExchangeSelectors.sol 2019-08-13 16:04:33 -07:00
Lawrence Forman
98f77394ed @0x/contracts-dev-utils: Update OrderValidationUtils for new isValidOrderSignature() semantics. 2019-08-12 19:18:57 -04:00
Lawrence Forman
5d54e6c951 @0x/contracts-dev-utils: Remove references to 'NoThrow' variants of
`MarketXOrders' functions.
2019-08-09 22:15:33 -04:00
James Towle
87bf940f89 @0x:contracts-exchange Refactor OrderTransferSimulationUtils 2019-07-23 15:53:25 -07:00
Amir Bandeali
0099cdd6ad Update comments and add a catch-all else in getSimulatedOrderTransferResults function 2019-07-23 15:52:20 -07:00
Amir Bandeali
983def2bbd Add OrderTransferSimulationUtils 2019-07-23 15:52:20 -07:00
Amir Bandeali
c22ed861d1 Remove ZRX fees from dev-utils contracts 2019-07-23 15:51:43 -07:00
Amir Bandeali
39bed4d306 temp 2019-07-23 15:51:43 -07:00
Amir Bandeali
5810e7df82 Add StaticCallProxy support to LibAssetData 2019-06-18 19:50:59 -07:00
Fabio Berger
212855ebd8 Add missing import 2019-06-12 09:29:19 -07:00
Fabio Berger
8986d506a5 Have DevUtils inherit from EthBalanceChecker 2019-06-12 09:08:18 -07:00
Fabio Berger
3d2c945c35 Fix nits in contract 2019-06-12 09:08:04 -07:00
Fabio Berger
43afe67593 Add EthBalanceChecker contract to monorepo 2019-06-11 08:45:15 -07:00
Amir Bandeali
f0c4ccfa1e Remove multiple returns from devdoc comments, fix typos 2019-06-07 08:46:52 -07:00
Amir Bandeali
b1cfdc7a6a Return 0 balance/allowance if the call would otherwise revert 2019-06-07 08:46:20 -07:00
Amir Bandeali
d9edb9675f Add tests for multiAssetData, remove tests for old functions 2019-06-07 08:46:20 -07:00
Amir Bandeali
be6fce5a89 Refactor contracts to only use allowances for AssetProxies (spender is no longer an input) 2019-06-07 08:46:20 -07:00
Amir Bandeali
12afeb30ae Move LibAssetData to DevUtils package 2019-06-07 08:46:20 -07:00
Amir Bandeali
f68b8d82e0 Move LibTransactionDecoder to dev-utils package 2019-06-07 08:46:20 -07:00
Amir Bandeali
6b7cb13e9a Move DevUtils contract into its own package 2019-06-07 08:46:19 -07:00