955 Commits

Author SHA1 Message Date
Lawrence Forman
f84b375cde
UniswapFeature (#2703)
* Minimal Uniswap accessor.

* Add comments

* Safe math

* mainnet gas benchmark

* Assembler Uniswap

* Selectors and addresses

* Fix bugs in ABI encoders

* Typo

* AsmUniswap test

* Fix wantAmount computation

* Golfing

* Bypass AllowanceTarget

* Generalized asm uniswapper

* Implement ordering

* Fix pair computation

* #6 Golfing Iron

* Remove 'to' argument (saves 377 gas)

* New contract api

* `@0x/contracts-zero-ex`: Add `UniswapFeature`

* `@0x/contract-artifacts`: Regenerate artifacts

* `@0x/contract-wrappers`: Regenerate wrappers

* `@0x/asset-swapper`: Add Uniswap VIP support.
`@0x/asset-swapper`: Add `includeSources` support.

* `@0x/contracts-zero-ex`: Fix misleading comments in `UniswapFeature`.
`@0x/asset-swapper`: Fix linter errors.

* `@0x/asset-swapper`: Fix source filter bugs.

* `@0x/contracts-zero-ex`: `UniswapFeature`: Reduce calldata size for AllowanceTarget call
`@0x/asset-swapper`: Fix failing test.

* `@0x/contracts-zero-ex`: Fix ETH buy tokens not being normalized to WETH.

* `@0x/asset-swapper`: Fix multi-hop weirdness with source filters.

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

* `@0x/asset-swapper`: Really fix that broken AS test.

* `@0x/asset-swapper`: use filter objects instead of source array for valid buy and sell sources/

* `@0x/asset-swapper`: Move some source filtering logic into the sampler operations.

* `@0x/contracts-zero-ex`: Address PR feedback

* `@0x/contracts-zero-ex`: Fix feature version bug.

* `@0x/asset-swapper`: Did I actually fix AS tests this time? Who knows.

Co-authored-by: Remco Bloemen <remco@0x.org>
Co-authored-by: Michael Zhu <mchl.zhu.96@gmail.com>
Co-authored-by: Lawrence Forman <me@merklejerk.com>
2020-09-23 16:27:48 +10: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
84a55a2d84 @0x/contract-wrappers: add exchangeProxy to ContractWrappers tyoe. 2020-07-30 13:56:00 -04:00
Lawrence Forman
b6700af6a8 @0x/contract-wrappers: Regenerate ERC20BridgeSampler wrapper. 2020-07-23 00:37:57 -04:00
Lawrence Forman
9d1615fa23 @0x/contract-wrappers: Fix doc gen 2020-07-23 00:03:23 -04:00
Lawrence Forman
b1b9949e72 @0x/contract-wrappers: Add IZeroEx wrapper. 2020-07-22 23:41:11 -04:00
xianny
b5eb1c9ee8 Publish
- @0x/contracts-asset-proxy@3.4.0
 - @0x/contracts-broker@1.1.6
 - @0x/contracts-coordinator@3.1.7
 - @0x/contracts-dev-utils@1.3.5
 - @0x/contracts-erc1155@2.1.7
 - @0x/contracts-erc20-bridge-sampler@1.7.0
 - @0x/contracts-erc20@3.2.1
 - @0x/contracts-erc721@3.1.7
 - @0x/contracts-exchange-forwarder@4.2.7
 - @0x/contracts-exchange-libs@4.3.7
 - @0x/contracts-exchange@3.2.7
 - @0x/contracts-extensions@6.2.1
 - @0x/contracts-integrations@2.6.0
 - @0x/contracts-multisig@4.1.7
 - @0x/contracts-staking@2.0.14
 - @0x/contracts-test-utils@5.3.4
 - @0x/contracts-utils@4.5.1
 - @0x/contracts-zero-ex@0.2.0
 - 0x.js@9.2.0
 - @0x/abi-gen@5.3.1
 - @0x/assert@3.0.9
 - @0x/asset-swapper@4.6.0
 - @0x/base-contract@6.2.3
 - @0x/connect@6.0.9
 - @0x/contract-addresses@4.11.0
 - @0x/contract-artifacts@3.7.1
 - @0x/contract-wrappers-test@12.2.16
 - @0x/contract-wrappers@13.8.0
 - @0x/contracts-gen@2.0.10
 - @0x/dev-utils@3.3.0
 - ethereum-types@3.2.0
 - @0x/instant@1.0.53
 - @0x/json-schemas@5.1.0
 - @0x/migrations@6.4.0
 - @0x/monorepo-scripts@1.0.54
 - @0x/order-utils@10.3.0
 - @0x/orderbook@2.2.7
 - @0x/sol-compiler@4.1.1
 - @0x/sol-coverage@4.0.10
 - @0x/sol-doc@3.1.8
 - @0x/sol-profiler@4.1.0
 - @0x/sol-resolver@3.1.0
 - @0x/sol-trace@3.0.10
 - @0x/sol-tracing-utils@7.1.0
 - @0x/sra-spec@3.0.9
 - @0x/subproviders@6.1.1
 - @0x/tslint-config@4.1.0
 - @0x/types@3.2.0
 - @0x/typescript-typings@5.1.1
 - @0x/utils@5.5.1
 - @0x/web3-wrapper@7.2.0
2020-07-14 21:48:14 -07:00
xianny
9d3755db36 Updated CHANGELOGS & MD docs 2020-07-14 21:47:59 -07: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
Lawrence Forman
23789b0692 @0x/contract-wrappers: Export GethCallOverrides. 2020-07-01 22:33:52 -04:00
Jacob Evans
7431651666
fix: package.json from publish (#2611) 2020-06-24 15:44:42 +10:00
Jacob Evans
4f91bfd907
Updated CHANGELOGS & MD docs 2020-06-24 14:12:56 +10:00
Lawrence Forman
f1f6aa7d80 Switch to using deployment nonce instead of transformer addresses. 2020-06-11 23:53:18 -04:00
Lawrence Forman
7ce7dd7252 @0x/asset-swapper: Address review feedback 2020-06-11 23:53:16 -04:00
Lawrence Forman
3e3bc5c06d @0x/contract-artifacts: Add ITransformERC20 artifact.
`@0x/contract-wrappers`: Add `ITransformERC20Contract`.
2020-06-11 23:50:25 -04:00
Michael Zhu
cd14a45414 Update sampler artifacts/wrappers 2020-06-11 12:47:54 -07:00
xianny
fbaf55cb25 update @0x/contract-artifacts and @0x/contract-wrappers 2020-06-03 13:45:35 -07:00
Jacob Evans
fb0311e675
feat: ERC20BridgeSampler Unlock Kyber collisions (#2575)
* feat: ERC20BridgeSampler Unlock Kyber collisions

* Updated fallback strategy

* Address comments

* Eth2Dai hop sampler

* Update packages/asset-swapper/src/utils/market_operation_utils/index.ts

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

* Set DFB expiry to 2hr

Co-authored-by: Lawrence Forman <lawrence@0xproject.com>
2020-05-07 07:56:03 +10: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
Xianny
b7fb5394a7
add gitpkg to contract-wrappers (#2520) 2020-03-13 10:10:32 -07:00
Daniel Pyrathon
659e8991de Completed feedback 2020-03-06 12:02:36 -08:00
Daniel Pyrathon
d8498134ad Merge branch 'development' of github.com:0xProject/0x-monorepo into feature/plp-integration
# Conflicts:
#	packages/contract-addresses/addresses.json
#	packages/contract-wrappers/package.json
2020-03-06 09:59:16 -08:00
Michael Zhu
6f5bf9d146 Add artifacts, wrappers, and addresses 2020-03-05 10:53:02 -08:00
Daniel Pyrathon
59091896b4 Merge branch 'development' of github.com:0xProject/0x-monorepo into feature/plp-integration
# Conflicts:
#	packages/asset-swapper/package.json
#	packages/asset-swapper/src/utils/market_operation_utils/sampler.ts
#	packages/asset-swapper/src/utils/market_operation_utils/types.ts
#	packages/asset-swapper/test/market_operation_utils_test.ts
2020-03-04 14:11:17 -08:00
Daniel Pyrathon
bc7504c469 refresh wrappers and artifacts 2020-03-04 08:24:35 -08:00
Jacob Evans
15f75a08d5
Publish
- @0x/contracts-asset-proxy@3.2.5
 - @0x/contracts-broker@1.1.4
 - @0x/contracts-coordinator@3.1.5
 - @0x/contracts-dev-utils@1.3.3
 - @0x/contracts-erc1155@2.1.5
 - @0x/contracts-erc20-bridge-sampler@1.5.1
 - @0x/contracts-erc20@3.1.5
 - @0x/contracts-erc721@3.1.5
 - @0x/contracts-exchange-forwarder@4.2.5
 - @0x/contracts-exchange-libs@4.3.5
 - @0x/contracts-exchange@3.2.5
 - @0x/contracts-extensions@6.1.5
 - @0x/contracts-integrations@2.5.1
 - @0x/contracts-multisig@4.1.5
 - @0x/contracts-staking@2.0.12
 - @0x/contracts-test-utils@5.3.2
 - @0x/contracts-utils@4.4.3
 - 0x.js@9.1.5
 - @0x/asset-swapper@4.4.0
 - @0x/contract-addresses@4.9.0
 - @0x/contract-wrappers-test@12.2.13
 - @0x/contract-wrappers@13.6.3
 - @0x/instant@1.0.50
 - @0x/migrations@6.2.4
 - @0x/order-utils@10.2.4
 - @0x/orderbook@2.2.5
2020-03-03 18:26:46 +11:00
Jacob Evans
29f9c5473d
Updated CHANGELOGS & MD docs 2020-03-03 18:26:14 +11:00
Daniel Pyrathon
82de5adbe9 refactored sampler operations into a single external file 2020-03-02 10:06:43 -08:00
Daniel Pyrathon
5d4bbd5b37 Merge branch 'development' of github.com:0xProject/0x-monorepo into feature/plp-integration
# Conflicts:
#	packages/asset-swapper/package.json
2020-02-28 15:50:34 -08:00
Daniel Pyrathon
3c0fd540b1 generated wrappers for ERC20 sampler 2020-02-27 13:53:52 -08:00
Jacob Evans
7742901e5c
Publish
- @0x/contracts-asset-proxy@3.2.4
 - @0x/contracts-broker@1.1.3
 - @0x/contracts-coordinator@3.1.4
 - @0x/contracts-dev-utils@1.3.2
 - @0x/contracts-erc1155@2.1.4
 - @0x/contracts-erc20-bridge-sampler@1.5.0
 - @0x/contracts-erc20@3.1.4
 - @0x/contracts-erc721@3.1.4
 - @0x/contracts-exchange-forwarder@4.2.4
 - @0x/contracts-exchange-libs@4.3.4
 - @0x/contracts-exchange@3.2.4
 - @0x/contracts-extensions@6.1.4
 - @0x/contracts-integrations@2.5.0
 - @0x/contracts-multisig@4.1.4
 - @0x/contracts-staking@2.0.11
 - @0x/contracts-test-utils@5.3.1
 - @0x/contracts-utils@4.4.2
 - 0x.js@9.1.4
 - @0x/asset-swapper@4.3.2
 - @0x/contract-addresses@4.8.0
 - @0x/contract-wrappers-test@12.2.12
 - @0x/contract-wrappers@13.6.2
 - @0x/instant@1.0.49
 - @0x/migrations@6.2.3
 - @0x/order-utils@10.2.3
 - @0x/orderbook@2.2.4
2020-02-28 08:13:33 +11:00
Jacob Evans
de68cb25d0
Updated CHANGELOGS & MD docs 2020-02-28 08:13:09 +11:00
Daniel Pyrathon
77d7afe505 created DummyPLPRegistry and DummyPLP + generated wrappers for these new contracts and their respective interfaces 2020-02-27 12:52:13 -08:00
Jacob Evans
2dd47a2103
Publish
- @0x/contracts-asset-proxy@3.2.2
 - @0x/contracts-broker@1.1.1
 - @0x/contracts-coordinator@3.1.2
 - @0x/contracts-dev-utils@1.3.0
 - @0x/contracts-erc1155@2.1.2
 - @0x/contracts-erc20-bridge-sampler@1.4.1
 - @0x/contracts-erc20@3.1.2
 - @0x/contracts-erc721@3.1.2
 - @0x/contracts-exchange-forwarder@4.2.2
 - @0x/contracts-exchange-libs@4.3.2
 - @0x/contracts-exchange@3.2.2
 - @0x/contracts-extensions@6.1.2
 - @0x/contracts-integrations@2.4.1
 - @0x/contracts-multisig@4.1.2
 - @0x/contracts-staking@2.0.9
 - @0x/contracts-test-utils@5.3.0
 - @0x/contracts-utils@4.4.0
 - 0x.js@9.1.2
 - @0x/abi-gen@5.2.1
 - @0x/assert@3.0.7
 - @0x/asset-swapper@4.3.0
 - @0x/base-contract@6.2.1
 - @0x/connect@6.0.7
 - @0x/contract-addresses@4.7.0
 - @0x/contract-artifacts@3.6.1
 - @0x/contract-wrappers-test@12.2.10
 - @0x/contract-wrappers@13.6.1
 - @0x/contracts-gen@2.0.8
 - @0x/dev-utils@3.2.1
 - @0x/instant@1.0.47
 - @0x/json-schemas@5.0.7
 - @0x/migrations@6.2.1
 - @0x/monorepo-scripts@1.0.51
 - @0x/order-utils@10.2.2
 - @0x/orderbook@2.2.2
 - @0x/sol-compiler@4.0.8
 - @0x/sol-coverage@4.0.8
 - @0x/sol-doc@3.1.5
 - @0x/sol-profiler@4.0.8
 - @0x/sol-trace@3.0.8
 - @0x/sol-tracing-utils@7.0.8
 - @0x/sra-spec@3.0.7
 - @0x/subproviders@6.0.8
 - @0x/utils@5.4.1
 - @0x/web3-wrapper@7.0.7
2020-02-25 20:43:55 +11:00
Jacob Evans
f31e530b6e
Updated CHANGELOGS & MD docs 2020-02-25 20:43:31 +11:00
Lawrence Forman
a425c7e260 Regenerate artifacts and wrappers 2020-02-19 15:50:10 -05:00
Jacob Evans
4a133ca36f
Publish
- @0x/contracts-asset-proxy@3.2.1
 - @0x/contracts-broker@1.1.0
 - @0x/contracts-coordinator@3.1.1
 - @0x/contracts-dev-utils@1.1.1
 - @0x/contracts-erc1155@2.1.1
 - @0x/contracts-erc20-bridge-sampler@1.4.0
 - @0x/contracts-erc20@3.1.1
 - @0x/contracts-erc721@3.1.1
 - @0x/contracts-exchange-forwarder@4.2.1
 - @0x/contracts-exchange-libs@4.3.1
 - @0x/contracts-exchange@3.2.1
 - @0x/contracts-extensions@6.1.1
 - @0x/contracts-integrations@2.4.0
 - @0x/contracts-multisig@4.1.1
 - @0x/contracts-staking@2.0.8
 - @0x/contracts-test-utils@5.1.5
 - @0x/contracts-utils@4.3.1
 - 0x.js@9.1.1
 - @0x/asset-swapper@4.2.0
 - @0x/contract-addresses@4.6.0
 - @0x/contract-artifacts@3.6.0
 - @0x/contract-wrappers-test@12.2.9
 - @0x/contract-wrappers@13.6.0
 - @0x/instant@1.0.46
 - @0x/migrations@6.2.0
 - @0x/order-utils@10.2.1
 - @0x/orderbook@2.2.1
2020-02-15 17:39:09 +11:00
Jacob Evans
f7252f919a
Updated CHANGELOGS & MD docs 2020-02-15 17:38:47 +11: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
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
7a52f12e57 Rebase and update contract artifacts + wrappers. 2020-02-11 12:07:48 -07:00
Lawrence Forman
55d6eddbb2 @0x/contract-artifacts: Update IERC20BridgeSampler wrapper. 2020-02-11 12:07:48 -07:00
Michael Zhu
f44eb4e383 Update changelogs for Forwarder changes 2020-02-10 17:11:01 -08:00
Michael Zhu
e3e0d00e21 Add Broker and GodsUnchainedValidator to contract-wrappers 2020-02-10 17:10:14 -08:00
Jacob Evans
5754c11e34
Publish
- @0x/contracts-asset-proxy@3.2.0
 - @0x/contracts-broker@1.0.2
 - @0x/contracts-coordinator@3.1.0
 - @0x/contracts-dev-utils@1.1.0
 - @0x/contracts-erc1155@2.1.0
 - @0x/contracts-erc20-bridge-sampler@1.3.0
 - @0x/contracts-erc20@3.1.0
 - @0x/contracts-erc721@3.1.0
 - @0x/contracts-exchange-forwarder@4.2.0
 - @0x/contracts-exchange-libs@4.3.0
 - @0x/contracts-exchange@3.2.0
 - @0x/contracts-extensions@6.1.0
 - @0x/contracts-integrations@2.3.0
 - @0x/contracts-multisig@4.1.0
 - @0x/contracts-staking@2.0.7
 - @0x/contracts-test-utils@5.1.4
 - @0x/contracts-utils@4.3.0
 - 0x.js@9.1.0
 - @0x/abi-gen@5.2.0
 - @0x/assert@3.0.6
 - @0x/asset-swapper@4.1.2
 - @0x/base-contract@6.2.0
 - @0x/connect@6.0.6
 - @0x/contract-addresses@4.5.0
 - @0x/contract-artifacts@3.5.0
 - @0x/contract-wrappers-test@12.2.8
 - @0x/contract-wrappers@13.5.0
 - @0x/contracts-gen@2.0.7
 - @0x/dev-utils@3.2.0
 - ethereum-types@3.1.0
 - @0x/instant@1.0.45
 - @0x/json-schemas@5.0.6
 - @0x/migrations@6.1.0
 - @0x/monorepo-scripts@1.0.50
 - @0x/order-utils@10.2.0
 - @0x/orderbook@2.2.0
 - @0x/sol-compiler@4.0.7
 - @0x/sol-coverage@4.0.7
 - @0x/sol-doc@3.1.4
 - @0x/sol-profiler@4.0.7
 - @0x/sol-resolver@3.0.3
 - @0x/sol-trace@3.0.7
 - @0x/sol-tracing-utils@7.0.7
 - @0x/sra-spec@3.0.6
 - @0x/subproviders@6.0.7
 - @0x/types@3.1.2
 - @0x/typescript-typings@5.0.2
 - @0x/utils@5.4.0
 - @0x/web3-wrapper@7.0.6
2020-02-09 09:37:34 +10:00
Jacob Evans
7bd88c1bb8
Updated CHANGELOGS & MD docs 2020-02-09 09:37:04 +10:00
Lawrence Forman
a08399dfee regenerate artifacts and wrappers 2020-02-07 23:23:23 -05:00