224 Commits

Author SHA1 Message Date
Lawrence Forman
705f46717f @0x/contracts-integrations: Add EP + MTX + RFQT integration tests. 2020-09-02 15:58:41 -04:00
Lawrence Forman
889b58a914 @0x/contracts-zero-ex: Add RFQT taker enforcement to FQT.
`@0x/contracts-zero-ex`: Remove redundant event from `BridgeAdapter`.
`@0x/contracts-zero-ex`: Treat all calldata as signed if quote signer is not in `TransformERC20Feature`.

`@0x/contracts-zero-ex`: Update bridge adapters
2020-09-02 15:58:38 -04:00
Lawrence Forman
d8844f6970 @0x/contracts-integrations: Fix broken tests. 2020-09-01 17:32:29 -04:00
Lawrence Forman
1cdc6e7184 @0x/contracts-integrations: Remove stray only modifier. 2020-09-01 16:56:32 -04:00
Lawrence Forman
2636384ead Merge remote-tracking branch 'origin/feat/exchange-proxy/post-cd-audit' into fix/ep/meta-transactions 2020-09-01 09:48:17 -04:00
mzhu25
bab34c2d21
Feature/bunny hop (#2647)
* `@0x/contracts-erc20-bridge-sampler`: Add TwoHopSampler + refactor

* `@0x/asset-swapper`: Refactor + add two-hop skeleton

* Round out two-hop support in asset-swapper

* Add BalancerSampler, use it for two-hop quotes

* Fix bugs discovered from simbot

* rebases are hard

* Add intermediate token to MultiHop source breakdown

* Fix market buy bugs

* Use hybrid on-chain/off-chain sampling for Balancer

* Another day, another rebase

* Update changelogs

* Address PR feedback, CI fixes

* Address more PR feedback
2020-08-27 08:20:09 +10:00
Jacob Evans
7e8b56eef4
feat: mStable + FQT Rollup (#2662)
* feat: mStable

* deploy and CHANGELOG

* `@0x/contracts-utils`: Add more testnet addresses.

* `@0x/contract-addresses`: Deply Mstable on testnets

* `@0x/contract-addresses`: Remove testnet deployments of mStable :-)

* move `erc20-bridge-sampler` into `asset-swapper`
remove `DevUtils` dependency from sampler contract.

* `@0x/asset-swapper`: Add ERC20BridgeSampler support for validating orders in maker fees denominated in non-maker assets.
`@0x/asset-swapper`: Add tests for `NativeOrderSampler`.

* `@0x/asset-swapper`: Return `0` sample if native order asset data is unsupported.

* `@0x/asset-swapper`: Fix failing test.

* feat: ExchangeProxy FQT fruit rollup (#2645)

* feat: Optimize Bridges in ExchangeProxy

* compile and most work

* work around to trust the delecall contract

* force allowances

* Update Kyber/Eth2Dai bridges

* Remove memory state where not required

* cleanup

* Combine Bridges into one adapter

* mixins

* refactor out ZeroExBridge

* move out interface

* comment out hacks

* update migrations

* remove simbot hacks

* AdapterAddresses and mStable

* Share constructor arg

* fix migration

* Remove whitespace

* `@0x/contracts-zero-ex`: BridgeAdapter -- revert if bridge address is 0.

* `@0x/contract-addresses`: Deploy FQT.

Co-authored-by: Lawrence Forman <me@merklejerk.com>
Co-authored-by: Lawrence Forman <lawrence@0xproject.com>

* update ganache contract addresses

* fix: asset-swapper empty batch call (#2669)

* update ganache contract addresses

* fix: asset-swapper prevent empty sampler batch call

* add sampler to migrations

* change migrations version

* Use contract-wrappers and artifacts

* remove extra data

* remove deps, set sampler to NULL_ADDRESS

* all the exports

* noop sell rate too

* update ganache contract addresses

Co-authored-by: Lawrence Forman <me@merklejerk.com>
Co-authored-by: Lawrence Forman <lawrence@0xproject.com>
2020-08-20 08:18:44 +10:00
Lawrence Forman
9b6703398e @0x/contracts-integrations: Add EP mtx tests. 2020-08-19 13:52:32 -04:00
Michael Zhu
e078f3d479 Appease CI 2020-08-19 09:50:39 -07:00
Lawrence Forman
e27e6baabe @0x/contracts-integrations: Add EP mtx tests. 2020-08-17 22:08:25 -04:00
Lawrence Forman
f172591059 @0x/contracts-integrations: Fix curve bridge mainnet tests. 2020-07-23 09:59:03 -04:00
Lawrence Forman
4dac620156 @0x/contracts-asset-proxy: Update CurveBridge to support more varied curves.
`@0x/contracts-erc20-bridge-sampler`: Refactor.
`@0x/contracts-erc20-bridge-sampler`: Add support for more varied curves.
`@0x/contracts-integrations`: Update curve bridge tests.
2020-07-23 00:36:32 -04:00
Jacob Evans
762e0aec2d
fix: Update to use KNP getExpectedRateAfterFee (#2629)
* Update to use KNP getExpectedRateAfterFee

* hack: use overrides instead of forking in ganache

* fix: added some tests using overrides

* override sampler

* Overrides in bridge_sampler_mainnet_test

* use getContracts to fake out tests

* chore: supply devUtils address

* feat: specify the call override by default

* CHANGELOGs

* export SamplerOverrides

* fix package.json

* fix: after rebase
2020-07-15 14:05:57 +10:00
mzhu25
ff9c9241d8
BalancerBridge (#2613)
* Add BalancerBridge and Sampler functions

* Update sampler artifacts/wrappers

* Add Balancer support to AssetSwapper + related refactoring

* Make use of GraphQL instead of sampler

* "fix" build and add mainnet BalancerBridge tests

* address some comments

* add balancer cache and fix DexSampler tests

* lint

* wip: tests for balancer sampler ops

* Fix market operation utils test

* balancer unit tests

* Return a buy quote of 0 if the buy amount exceeds the Balancer pool's balance

* Dynamic fee estimation

* Update contract addresses, export BalancerBridge wrapper

* Update changelogs

* Fix bugs discovered via simbot

* Fix issues in balancer_utils

* override `BigNumber.config` in configured_bignumber.ts

* Special case Balancer subops in  too

* Address some more comments

* Address Balancer performance issue

* Performance improvements

* Address comment

* Fix tests

Co-authored-by: xianny <xianny@gmail.com>
2020-07-14 19:18:50 -07:00
Jacob Evans
a458e81f8d
ERC20BridgeSampler: Additional Buy support (#2551)
* ERC20BridgeSampler: Sample Curve Buy

* Fake Buy Kyber/PLP

* Deploy mainnet

* Add Kyber rates for buy tests

* CHANGELOGs

* Provide maxIterations and targetSlippage as options

* Cleanup ERC20BridgeSampler for re-use

* Redeploy Mainnet Kovan

* Feedback fixes

* Handle OOG/revert 0s

* Redeploy Mainnet refactor
2020-04-21 13:26:12 +10:00
Jacob Evans
424cbd4831
Forwarder Market sell specified amount or throw (#2521)
* Forwarder Market sell specified amount or throw

* Address feedback comments

* Break if we have only protocol fee remaining

* Lint

* Update deployed addresses

* Updated artifacts and wrappers

* [asset-swapper] Forwarder throws on market sell if amount not sold (#2534)
2020-03-31 16:25:34 +10:00
Lawrence Forman
7775541eed @0x/contracts-integrations: Update ERC20BridgeSampler tests 2020-03-26 12:09:14 -04:00
Lawrence Forman
0baec61f06 @0x/contracts/integrations: Update wallets and add comments with last run gas costs to benchmarks. 2020-02-26 12:57:03 -05:00
Lawrence Forman
d4751788d1 @0x/contracts-integrations: Add ChaiBridge and DydxBridge gas benchmark tests. 2020-02-26 11:29:44 -05:00
Lawrence Forman
a04722b612 @0x/contracts-integrations: Add USDC->DAI forked dydx bridge order validation. 2020-02-19 15:51:05 -05:00
Lawrence Forman
58f772c74e foo 2020-02-19 15:51:05 -05:00
Lawrence Forman
bf9b4b993f @0x/contracts-test-utils: Fix blockchainTests fork config to work with other tests. 2020-02-19 15:49:41 -05:00
Lawrence Forman
d94a26f0f4 @0x/contracts-integrations: Add DydxBridge validation integration tests. 2020-02-19 15:49:41 -05:00
Lawrence Forman
9b3781abf1 Cherry pick dydx validation from #2456 2020-02-19 15:45:27 -05:00
Jacob Evans
e05a03a842
Curve ERC20Bridge (#2480)
* Curve ERC20Bridge

* ERC20BridgeSampler Curve (#2483)

* ERC20Sampler Curve

* Use Bridge Sources for each Curve

* Support multiple versions of the Curve contract

* CHANGELOG and redeployed Curve (mainnet)

* Fix Market ops utils test

* Added Curve DAI USDC USDT TUSD

* Bump sampler gas limit default

* Decode the Curve in tests

* Disable Curve in Buy tests

* blockchainTests.fork.resets Curve and Sampler
2020-02-15 17:02:19 +11:00
mzhu25
dcce8276b8
Add decoders for broker and stop-limit data (#2484)
* Add decoders for broker and stop-limit data

* update changelogs

* Address comments
2020-02-14 17:38:43 -08:00
Alex Towle
6e5c788e13 Added a test that fails for the old DevUtils 2020-02-13 17:37:03 -08:00
Greg Hysen
871105a48a Fixed dYdX Bridge Tests 2020-02-13 13:19:26 -08:00
mzhu25
f471c79b59
Chainlink stop-limit orders (#2473)
* Contracts for Chainlink stop-limit orders

* Tests and asset data utils

* Update contracts-integrations changelog

* Address comments

* Remove priceFreshness parameter

* Remove LibSafeMath

* fix typo

* Add ChainlinkStopLimit addresses to @0x/contract-addresses
2020-02-11 15:10:06 -08:00
Lawrence Forman
4016808fa4 Cherry pick DevUtils refactor code from #2456 2020-02-07 23:23:23 -05:00
Lawrence Forman
ae650849b0 Rebase and address review comments. 2020-02-07 22:29:32 -05:00
Lawrence Forman
3e8f9a6b53 Cherry-pick changes from feat/dev-utils/dydx-bridge-validation 2020-02-07 22:10:10 -05:00
Michael Zhu
d82f34fe59 add weth-related integration tests 2020-02-04 10:13:07 -08:00
Michael Zhu
d2313b30af Address PR feedback and add support for affiliate fees 2020-02-04 10:13:07 -08:00
Michael Zhu
329719472a Move LibAssetDataTransfer and MixinWeth(Utils) to contracts-extensions 2020-02-04 10:13:02 -08:00
Michael Zhu
a2fcab47d4 skip coordinator client test 2020-02-04 10:08:25 -08:00
Michael Zhu
4ab5951c25 Add comments 2020-02-04 10:08:25 -08:00
Michael Zhu
403cabb201 more integrations tests 2020-02-04 10:08:25 -08:00
Michael Zhu
b8ac9c2edd lint 2020-02-04 10:06:10 -08:00
Michael Zhu
1027ee2481 Broker integrations tests 2020-02-04 10:05:17 -08: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
mzhu25
9b20359e7b
Merge pull request #2431 from 0xProject/feature/fuzz/revert-assertions
`@0x/contracts-integrations`: Negative assertions for fuzzing
2020-01-17 13:10:00 -08:00
Amir
41b1b1f141 Skip failing dydxBridge tests 2020-01-17 10:47:17 -08:00
Amir
6afa9c8b92 Add mainnet integration tests for checking balances/allowances of ChaiBridge orders using DevUtils 2020-01-17 10:00:16 -08:00
Amir
2fc449da4c Fix integrations tests build 2020-01-17 10:00:16 -08:00
mzhu25
6332673434
Merge pull request #2436 from 0xProject/fix/dev-utils/map-fixes
`@0x/contracts-dev-utils`: LibAssetData fixes
2020-01-15 16:10:11 -08:00
Michael Zhu
f217840998 address comments 2020-01-15 13:22:53 -08:00
Michael Zhu
fecd0b809e tslint be trippin 2020-01-15 13:20:54 -08:00
Michael Zhu
4707a46561 Add negative assertions for endEpoch 2020-01-15 13:20:54 -08:00
Michael Zhu
616533c5a8 Add negative assertions for moveStake 2020-01-15 13:20:54 -08:00