149 Commits

Author SHA1 Message Date
Jacob Evans
80193215e3
feat: Migrate PositiveSlippage tests [LIT-804] (#650)
* feat: PositiveSlippageTransformer tests

* Remove old tests

* Affilite fee tests

* Create mintable erc20 token for v06

* Update MintableERC20TokenV06 name
2023-02-07 08:22:02 +10:00
Github Actions
f8b65bd429 Updated CHANGELOGS & MD docs 2023-01-30 18:59:52 +00:00
Elena
d2be56c30f
Code coverage fixes (#640)
* Update coveralls link to point to protocol repo coverage

* Remove obsoleted ignores in .gitignore

* Run forge coverage in CI and upload results to coveralls

* Remove unused wrapper

* Remove legacy coverage setup

* Remove lcov-result-merger

* Add base-path setting to coverallsapp in CI
2023-01-17 10:53:43 +02:00
Elena
c4097e4203
Migrate ZeroEx proxy tests to foundry (#638)
* Implement base instantiation of the ZeroEx proxy in foundry
and move TestZeroExFeature contract to the foundry mocks

* Migrate zero-ex tests to foundry

* Update copyright year

* Update contracts/zero-ex/tests/mocks/TestZeroExFeature.sol

Co-authored-by: Jacob Evans <jacob@dekz.net>

Co-authored-by: Jacob Evans <jacob@dekz.net>
2023-01-12 11:45:33 +02:00
Elena
b33fc27220
Migrate FlashWallet tests to foundry (#637)
* Remove contracts/zero-ex/contracts/test/TestBridge.sol

* Move foundry tests to their default location

* Wire up base foundry test and start moving
FlashWallet tests and mocks to foundry

* Move remaining FlashWallet contract tests to foundry

* Switch to foundry default cache config
2023-01-10 15:47:25 +02:00
Savarn Dontamsetti (Sav)
3f8dbf3fe9
Removing Balancer V2 from Bridge Adapters (#629) 2022-12-12 10:08:15 -05:00
Elena
4d9b68d527
Removes references to tslint (#619)
* Removes references to tslint in contract-wrappers
which are obsoleted since https://github.com/0xProject/protocol/pull/584

* Remove tslint references in contracts/utils and test utils
obsoleted by https://github.com/0xProject/protocol/pull/589

* Remove tslint references in contracts/zeroex and test utils
obsoleted by https://github.com/0xProject/protocol/pull/587

* Remove other obsoleted tslint references

* Update contributing guidelines with eslint

* Fix prettier errors
2022-11-19 17:52:00 +02:00
Github Actions
1516bf6a24 Updated CHANGELOGS & MD docs 2022-11-05 00:19:08 +00:00
Kyu
7368aded88
Rename VelodromeMixin to SolidlyMixin and add Solidly support to PolygonBridgeAdapter (#612) 2022-11-04 14:41:35 -07:00
Noah Khamliche
bf1b5c4257
Fix: FQT otc order encoding logic (#596)
* swap rfq and otc in fillQuoteTransformerDataEncoder to match our enum

* changelog

* fix changelog and move otcOrders field to last in fillQuoteTransformerDataEncoder

* prettier

* move otcOrders array to end of fqtTransformData

Co-authored-by: Noah Khamliche <0xnoah@Noahs-MacBook-Pro-2.local>
2022-10-12 17:10:16 -04:00
Github Actions
69f8fd39f7 Updated CHANGELOGS & MD docs 2022-10-11 23:45:49 +00:00
Elyas
b04455c36f
chore: Configure prettier-solidity and run prettier-solidity [TKR-532] (#592)
* add prettier-solidity + config

* run prettier

* update lockfile

* run prettier again

* Prettier missed one /:

* keep bridge adapter the same

* yarn prettier
2022-10-06 11:44:57 -04:00
Github Actions
a689e98b0f Updated CHANGELOGS & MD docs 2022-10-05 23:42:41 +00:00
eobbad
b6597df84f
ignore generated wrappers and asset-swapper (#591) 2022-09-26 16:05:55 -04:00
Ido Kleinman
390e1b8510
chore: Replace TSLint with ESLint in contracts/zeroex (#587)
* replace tslint with eslint

* config file

* fix linting errors

* changelog

* prettier
2022-09-23 12:39:17 -07:00
Noah Khamliche
e51e1f1674
added otc order array to createTranformData (#569)
* added otc order array to createTranformData

* changelog

* fix linting

Co-authored-by: Noah Khamliche <0xnoah@Noahs-MacBook-Pro-2.local>
2022-08-31 11:37:50 -04:00
Jacob Evans
4425c316a3
chore: update packages (#553)
* Update package.jsons to latest tools packages

* Skip tests relying on gasPrice > 0

* Yarn.lock

* Fix linter

* Update Balance checker, new ganache gets more ETH

* Fix new Ganache insufficient assertion string

* Temporarily set QuoteRequestor to skip

* Fix headers Axios now requests with
2022-08-22 14:55:42 +10:00
Github Actions
939b708e63 Updated CHANGELOGS & MD docs 2022-08-10 01:12:31 +00:00
Github Actions
01a6d933ca Updated CHANGELOGS & MD docs 2022-08-09 19:27:24 +00:00
eobbad
c12a10b96e
Add WooFI support (#513)
* Add WooFI interface for sampling

* WooFi Sampler

* Add mixin

* Update bridge adapters

* fix some bugs

* update transformer_utils

* Add BSC support

* yarn prettier

* Capitalize WOOFI in bridge adapters

* Put rebateAddress in a constant, fixed some other stylistic errors

* bug fixes

* Updated CHANGELOGS & MD docs

* Publish

 - @0x/contracts-erc20@3.3.33
 - @0x/contracts-test-utils@5.4.24
 - @0x/contracts-treasury@1.4.16
 - @0x/contracts-utils@4.8.14
 - @0x/contracts-zero-ex@0.36.0
 - @0x/asset-swapper@16.64.0
 - @0x/contract-addresses@6.17.0
 - @0x/contract-wrappers@13.20.5
 - @0x/protocol-utils@11.16.0

* Update reference.mdx (#531)

Align with `DEFAULT_QUOTE_SLIPPAGE_PERCENTAGE` value from c74e31c219/src/constants.ts (L26)

* code cleanup

* remove deusdc curve pool from this pr

* Refactor PoolsCache (part 1) [TKR-500] (#525)

* Make _refreshPoolCacheIfRequiredAsync type-safe and remove Promise.all

* Factor out PoolsCache key logic into a function

* Use Map instead of object in PoolsCache and increase the default timeout

* Clean up PoolsCache and simplify its public interface

* Refactor PoolsCache (part 2) [TKR-500]  (#526)

* Introduce NoOpPoolsCache and use it in unsupported chains for BeethovenX

* Use `NoOpPoolsCache` for `CreamPoolsCache` and `BalancerPoolsCache` on unsupported chains

* Remove `getBidAskLiquidityForMakerTakerAssetPairAsync` (#528)

* Add transfer approval for quote token for multi-hops and fix buy sampler typo

* Use 0x gas api instead of eth gas station api [TKR-502] (#532)

* Use 0x gas api instead of eth gas station api

* Add integration test for `ProtocolFeeUtils`

* Update CHANGELOG.json

* Add polygon, fantom, avalanche support

* yarn prettier

* Updated CHANGELOGS & MD docs

* Publish

 - @0x/asset-swapper@16.65.0

* Remove references to `custom-no-magic-numbers` ts lint rule [TKR-484] (#533)

* Remove references to `custom-no-magic-numbers ts` lint rule

* Run prettier

* resolve Kyu's comments

* remove fqt change

* Add WooFI interface for sampling

* WooFi Sampler

* Add mixin

* Update bridge adapters

* fix some bugs

* update transformer_utils

* Add BSC support

* yarn prettier

* Capitalize WOOFI in bridge adapters

* Put rebateAddress in a constant, fixed some other stylistic errors

* bug fixes

* code cleanup

* remove deusdc curve pool from this pr

* Add transfer approval for quote token for multi-hops and fix buy sampler typo

* Add polygon, fantom, avalanche support

* yarn prettier

* resolve Kyu's comments

* remove fqt change

* merge types.ts

* WOOFi -> WOOFI

* fix lerna run lint

* Changelog

* nit changes

Co-authored-by: Github Actions <github-actions@github.com>
Co-authored-by: Pavel <51318041+pavel-bc@users.noreply.github.com>
Co-authored-by: Kyu <kyuhyun217@gmail.com>
2022-08-03 15:54:09 -04:00
Kyu
a5babb9a34
Add Synthetix Atomic Swap support [TKR-324] (#518)
* Implement SyntehtixSampler

* Implement MixinSynthetix

* Update transformer_utils.ts

* Add Synthetix mainnet support

* Add Synthetix optimism support

* Fine-tune gas schedule

* Pass read proxy dynamically to SynthetixSampler

* Pass read proxy dynamically to SynthetixMixin

* Fetch Synthetix address from sampler

* Pass Synthetix address directly to MixinSynthetix

* Update CHANGELOG.json
2022-07-25 21:17:27 -07:00
Kyu
1cc59ab1ab
feat: Add Velodrome support [TKR-432] (#494)
* Implement MixinVelodrome

* Add preliminary implementation of VelodromeSampler

* Add Velodrome in BridgeProtocol of transformer_utils.ts

* Fix MixinVelodrome

* Wire Velodrome sampler in market_operation_utils

* Fix lint error

* Remove gas schedule TODO

* Format VelodromeSampler.sol

* Fix MixinVelodrome

* Update CHANGELOG.json
2022-06-13 11:55:40 -07:00
Noah Khamliche
f5c486050b added bancor mixin/sampler and started linking up with asset-swapper 2022-06-03 15:03:00 -04:00
mzhu25
cf8fc0ff8e
Split up BridgeAdapter by chain [TKR-402] (#487)
* Split up BridgeAdapter by chain

* Fix BridgeProtocols enum

* Add isSupportedSource to bridge adapter contracts

* Add bridge adapter tests

* Fix FQT test
2022-05-25 14:18:24 -04:00
Kyu
2d16f83e37
Offboard/clean up Oasis, CoFix, and legacy Kyber [TKR-405] (#482)
* Remove Oasis

* Remove CoFix code

* Remove MixinKyber

* Remove Kyber from asset-swapper

* Delete unused imports, interface, and etc.

* Fix the test failure issue when it's run with neon-router

* Update CHANGELOG.json
2022-05-19 17:39:02 -07:00
Noah Khamliche
9a28e51f51 rebased dev and merged 2022-05-18 19:53:50 -04:00
Lawrence Forman
470e9a4697
AS: Balancer V2 batchSwap (#462)
* Draft. PoC pseudo code showing general idea for resuing SOR path creation logic and adding multihop support.

* Add actual Balancer SDK function calls.

* Update to handle buys.

* Correct taker>maker for buy.

* Draft. PoC pseudo code showing general idea for resuing SOR path creation logic and adding multihop support.

* make it build

* rebase

* add BalancerV2Batch protocol

* add BalancerV2Batch protocol

* get balancer v2 multihop working

* fix BalancerV2Batch for sells (buys still iffy)

* fix buys, appease linter and prettier

* remove unused RPC URL from balancer sdk construction

* update changelogs

* clean up comments
add event loop yield in `BalancerV2SwapInfoCache.loadTopPools()`

* add negative result check on balancerv2batch swap output

* compiler hack

* reintroduce CompilerHack

* delete unused multibridge sampler

* remove compilerhack

* reintroduce compilerhack

* try to fix CI compile errors

* plz work

* plz work

* pretty plz work

* yay it works, also address feedback

* appease linter

* deploy new FQTs

Co-authored-by: johngrantuk <johngrantuk@googlemail.com>
Co-authored-by: Lawrence Forman <me@merklejerk.com>
2022-04-22 02:43:41 -04:00
mzhu25
c1177416f5
[Final] ERC721 and ERC1155 Orders (#429)
* add LibERC721Order.sol

* Add ERC721 interface to vendor/

* Add ERC721OrdersFeature interface

* Storage lib for ERC721 orders feature

* Implement basic functionality for ERC721 orders (buy, sell, cancel, etc)

* Add isValidERC721OrderSignature to interface

* implement onERC721Received

* Implement batchBuyERC721s

* left/right orders -> sell/buy orders

* Add missing @return comments

* Implement matching functions

* Use SafeMath where necessary

* add rich errors for ERC721OrdersFeature

* Add comments

* Add presign support for ERC721 orders

* Cancel using just the order nonce

* Add IERC721OrdersFeature to IZeroEx

* Add taker callback

* Assembly optimizations in LibERC721Order

* Add ERC721Orders TS class

* create zero-ex/contracts/test/integration/ and tokens/ directories

* TestMintableERC721Token

* tmp

* address feedback from original PR (#391)

* address feedback from original PR

* Update contracts/zero-ex/contracts/src/features/ERC721OrdersFeature.sol

Co-authored-by: Kim Persson <kimpers@users.noreply.github.com>

* address review feedback and improve order parameter naming

* Add batchCancel function

* Emit order fields in preSign

* Fix tests

Co-authored-by: Lawrence Forman <me@merklejerk.com>
Co-authored-by: Kim Persson <kimpers@users.noreply.github.com>
Co-authored-by: Michael Zhu <mchl.zhu.96@gmail.com>

* Remove revertIfIncomplete from batchMatch

* Sanity check maker address in preSign

* ERC1155OrdersFeature contracts

* Commence refactor, abstract base contract

* ERC721OrdersFeature inherits from NFTOrders

* Refactor ERC1155OrdersFeature to inherit from NFTOrders

* Fix order hashing

* Fix ERC721OrdersFeature tests

* Typos

* Remove maker address from preSigned mapping

* disable dex sampler tests

* Refactor TS tooling

* Address PR feedback

* Rearrange event fields to better align with struct fields

* Update comments

* update AbiEncoder.create params

* Add ERC1155Order to protocol-utils

* Add ERC1155OrdersFeeature tests

* Bump package versions and regenerate contract wrappers

* Add ERC165Feature

* NFT orders: address audit findings (#417)

* CVF-1: use pragma solidity ^0.6 instead of ^0.6.5

* CVF-11: fix inaccurate comment

* CVF-16: Enable taker callbacks for batchBuyERC1155s

* CVF-17: use internal call if revertIfIncomplete is true

* CVF-21: avoid duplicate SLOAD

* CVF-23: merge if statements

* CVF-24: Reorder status checks to be consistent with ERC721OrdersFeature

* CVF-25: Update unclear comment (canonical hash -> EIP-712 hash)

* CVF-31: Document keys of orderState mapping

* CVF-45: DRY up fees/properties hashing

* CVF-47, CVF-50, CVF-57: calculate properties.length once; hash propertyStructHashArray in-place using assembly

* CVF-56: More descriptive names for assembly variables

* CVF-71: Update confusing comment about rounding in _payFees

* CVF-72: Move ETH assertions outside of loop in _payFees

* CVF-74: Move property validation loop to else branch

* CVF-82: Update inaccurate comment

* CVF-86: Enable taker callbacks for batchBuyERC721s

* CVF-87: use internal call if revertIfIncomplete is true

* CVF-89: Perform token mismatch checks before stateful operations

* CVF-90, CVF-91: Defer ERC20 token mismatch check

* CVF-93: Add inline comments for _payFees parameters in matchERC721Orders

* CVF-94: Fix comment (Step 7 -> Step 5)

* CVF-98: Use binary & operator instead of mod

* CVF-99: Update unclear comment (canonical hash -> EIP-712 hash)

* CVF-65, CVF-66, CVF-67: Copy params.ethAvailable into local variable; check that ethSpent does not exceed ethAvailable; remove ethAvailable < erc20FillAmount check

* CVF-52, CVF-55, CVF-59: calculate fees.length once; hash feeStructHashArray in-place using assembly

* CVF-14, CVF-32: OrderState struct; separate storage mapping for 1155 cancellations so orders can be cancelled by nonce

* Update changelogs, IZeroEx artifact/wrapper

Co-authored-by: Lawrence Forman <lawrence@0xproject.com>
Co-authored-by: Lawrence Forman <me@merklejerk.com>
Co-authored-by: Kim Persson <kimpers@users.noreply.github.com>
2022-02-22 10:00:22 -08:00
Kim Persson
9615570dc6
feat: deploy interest tokens (#321)
* feat: Aave aToken deposit/withdrawal [TKR-111] (#293)

* feat: AaveV2 deposit/withdrawal integration WIP

* feat: add basic Aave Reserves cache with data from subgraphs WIP

* feat: hook up Aave Reserves integration

* fix: set allowance before trade & use ERC20 token interface

* refactor: pass aToken to mixin to avoid lookup

* fix: migrate from swap/revert to normal sampling

* fix: Aave gas estimate & refactor to clean up code

* feat: Create a sampler no operation type and make AaveV2Sampler a no-op

* fix: Clipper merge conflict resolution issues

* fix: don't fetch unnecessary Aave pool data & clean up code

* chore: Add changelog entries

* feat: cToken deposit/withdrawal [TKR-222] (#294)

* feat: first stab at a CompoundSampler implementation

* feat: MixinCompound implementation WIP

* feat: Compound integration with cache WIP

* fix: decimals scaling in CompoundSampler

* feat: handle minting and redeeming of cETH

* fix: adjust Compound gas schedule

* refactor: clean up code and add comments in cToken cache

* fix: MixinCompound check allowance on WETH withdrawal & fix indentation

* fix: address review comments and clean up code

* chore: add changelog entries

* feat: enable AaveV2 on Avalanche

* chore: add freshly deployed FQT on Polygon, Avalanche

* fix: temporarily disable on Ethereum mainnet until we redeploy EP

* fix: address PR comments and update changelogs

* fix: correct contract-addresses changelog note
2021-12-01 17:10:22 +01:00
Lawrence Forman
4b3d98f43c
@0x/contracts-zero-ex: Prevent EP ETH balance from reducing when executin mtxs (#365)
Co-authored-by: Lawrence Forman <me@merklejerk.com>
2021-11-09 22:11:36 -05:00
Romain Butteaud
0945d4cef2
fix: removing Clipper custom integration (to add it later as a real PLP) (#335)
* fix: removing Clipper custom integration (to add it later as a real PLP)

* fix: update CHHANGELOG

* fix: keep Clipper as BridgeProtocols so we dont have to redeploy and comment this is not used

* fix: prettier
2021-10-04 11:39:07 -07:00
Noah Khamliche
0caf495a1a fixed prettier error with tests 2021-09-01 17:07:16 -04:00
Noah Khamliche
a20de0fc69 Added support for TestMintableERC20TokenContract instead of DummyERC20 2021-09-01 17:07:16 -04:00
Noah Khamliche
6bb72dd775 ran yarn prettier to fix issues 2021-09-01 17:07:16 -04:00
Noah Khamliche
77d1ed257c removed unsued bal variable, and removed .only modifier on blockchain tests 2021-09-01 17:07:16 -04:00
Noah Khamliche
5d265360c4 fixed linting and EP transfering less than the total amount of ETH in the wallet 2021-09-01 17:07:16 -04:00
Noah Khamliche
c9097f6e8b fixed rebase issues 2021-09-01 17:07:16 -04:00
Noah Khamliche
d3df985a42 fixed michaels comments and finished off writing the test 2021-09-01 17:07:16 -04:00
Noah Khamliche
7267420874 fixed rebase issues 2021-09-01 17:07:16 -04:00
Noah Khamliche
17e81432f1 Fixed PR comments, now onto writing tests 2021-09-01 17:07:16 -04:00
Noah Khamliche
57c767c3b1 fixed package.json 2021-09-01 17:07:16 -04:00
mzhu25
b46eeadc64
Feat/multiplex/v2 (#263)
* Refactor Multiplex into multiple files

* Pull UniswapV3 into separate file

* Add support for multihop nested within batch sell

* Add useSelfBalance and recipient to _fillRfqOrder

* Expose onlySelf variant in UniswapV3Feature for Multiplex

* Add useSelfBalance and recipient to _transformERC20

* Add support for proportional fill amounts in batchSell

* Comments and renaming

* Unit tests

* Use caps for immutables

* Rename taker -> recipient in TransformContext and SettleOrderInfo

* lint

* Address nits

* Swallow reverts for LiquidityProvider and UniswapV2 batch sells

* Address spot-check findings (#279)

* Check didSucceed in _callWithOptionalBooleanResult

* Add takerToken=ETH support to OtcOrdersFeature (#287)

* Add takerToken=ETH support to OtcOrdersFeature

* Add batchFillTakerSignedOtcOrders

* Add support for OTC to Multiplex

* Address PR feedback

* Update TransformERC20Feature (#303)

* remove multiplex_utils

* Update changelog

* unbreak tests
2021-08-12 17:09:46 -07:00
Jacob Evans
a35af11981
feat: Clipper (#299)
* feat: Clipper

* feat: Curve tricrypto2 (#302)

* Scope down the token list search space for Clipper

* update deployed addresses
2021-08-06 14:12:43 +10:00
Kim Persson
7580719586
feat: Lido StETH deposit integration [TKR-90] (#260)
* feat: initial stab at the LidoSampler and the MixinLido

* feat: full integration of lido sampler and mixin

* fix: return pooled Ether amount not shares & properly unwrap WETH

* refactor: clean up Lido sampler and data passing

* fix: lower gas schedule for WETH to stETH deposits

* refactor: remove MixinLido unused ETH code path

* chore: add changelog entries

* fix: lower Lido gas schedule slightly

* fix: revert MixinLido on unsupported token pair

* fix: address review comments, improve early exit if wrong tokens

* fix: add contract addresses to Lido FQT
2021-06-22 11:25:47 +02:00
Romain Butteaud
d07c7d5b69
feat: Curve V2 (#262)
* feat: Curve V2

* fix: CurveV2 gas schedule, remove unused import from MixinCurveV2

* feat: FQT address update

* chore: Curve V2 exchange_underlying, adding Polygon atricrypto pool

* prettier

* feat: FQT Polygon address update

* feat: FQT address update
2021-06-10 19:01:11 -07:00
Lawrence Forman
901d400d62
Address spot check feedback (#251)
* UniswapV3 VIP (#237)

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

* `@0x/contracts-zero-ex`: Add UniswapV3 VIP
`@0x/contract-artifacts`: Regenerate.
`@0x/contract-wrappers`: Regenerate.
`@0x/asset-swapper`: Add UniswapV3 VIP support.

* address review comments and appease linter

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

* Multiplex UniswapV3 (#241)

* Add UniswapV3 support to Multiplex batchFill

* Add AssetSwapper support for Multiplex UniswapV3

* fix repo scripts that use PKG= env var (#242)

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

* `@0x/asset-swapper`: Adjust uniswap gas overhead

Co-authored-by: Lawrence Forman <me@merklejerk.com>
Co-authored-by: mzhu25 <mchl.zhu.96@gmail.com>

* OTC orders feature (#244)

* Add OTC orders feature contracts

* Address PR feedback

* Remove partial fills for takerSigned variant

* Add function to query the min valid nonce

* Add ETH support

* Tightly pack expiry, nonceBucket, and nonce

* Address PR feedback

* OTC orders unit tests

* Bump prettier version

* Skip unnecessary math if takerTokenFillAmount == order.takerAmount

* appease CI

* Update contract-artifacts and contract-wrappers and CHANGELOGs

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

* `regen wrappers

* prettier

* `@0x/asset-swapper`: prettier and tweak gas schedule slightly for uni3

Co-authored-by: Lawrence Forman <me@merklejerk.com>
Co-authored-by: mzhu25 <mchl.zhu.96@gmail.com>
2021-06-02 14:21:14 +10:00
Jacob Evans
966d54c935
fix: KyberDmm (#236)
* fix: KyberDmm

* fix: pass buyToken to kyberDmm and require that path ends with buyToken

* Pass BigNumber down to FastABI

* Address Feedback

Co-authored-by: Kim Persson <kimpersson88@gmail.com>
2021-05-18 08:12:28 +10:00
mzhu25
a744acc7bc
Add special selectors to selector collision test (#243) 2021-05-14 10:50:58 -07:00
Lawrence Forman
a2d42b07b5
UniswapV3 [TKR-4] (#197)
* add balancer v2

* fetch balancer v2 pools from subgraph

* feat: initial stab at a Balancer V2 Sampler WIP

* feat: add sampling for buys and fix build issues WIP [untested]

* fix: BalancerV2Sampler implementation issues, works on Kovan

* chore: BalancerV2 sampling boilerplate

* fix: update Balancer V2 mainnet address

* fix: consolidate differences between the 2 working branches

* fix: use mainnet Balancer V2 subgraph

* fix: stack too deep by minimizing and inline Balancer V2 vault interface

* fix: address review comments and clean up

* fix: sampler vault interface and pools cache assuming a pool has swaps

* address more review comments

* fix: TS type issues and add a comment about deadline argument

* fix: pools_cache_tests incorrect token addresses, prettier incompat

* fix: make ERC20BridgeSampler support BalancerV2 non view sampler fns

* fix: use a struct for passing encoded bridge data for Balancer V2

* chore: add changelog entries

* fix: improve gas accuracy of gas schedule for Balancer V2 & Maker Psm

* fix: don't exclude sources with stale caches & wait for cache refresh

* rebase

* `@0x/asset-swapper`: Fix stack too deep errors in sampler

* `@0x/asset-swapper`: Add uniswap V3 sampler.

* `@0x/contracts-zero-ex`: Add UniswapV3 support to FQT

* `@0x/protocol-utils`: Update BridgeProtocols.
`@0x/asset-swapper`: Add sell integration for UniswapV3.

* `@0x/asset-swapper`: Remove unnecessary swap quote consumer constructor arg.
`@0x/asset-swapper`: Enable UniswapV3 on ropsten.

* `@0x/asset-swapper`: UniswapV3 fixes

* `@0x/asset-swapper`: Fix stuff based on latest deployed testnet contracts

* `@0x/asset-swapper`: Remove UniV3 from mainnet sources for now

* `@0x/asset-swapper`: Tweak univ3 gas schedule

* fix CI?

* `@0x/contracts-test-utils`: Set default ganache gas limit to 100e6

Co-authored-by: xianny <xianny@gmail.com>
Co-authored-by: Kim Persson <kimpersson88@gmail.com>
Co-authored-by: Lawrence Forman <me@merklejerk.com>
Co-authored-by: Jacob Evans <jacob@dekz.net>
2021-05-05 19:44:17 +10:00
Xianny
f9a794af93
feat: Balancer V2 integration (#206)
* add balancer v2

* fetch balancer v2 pools from subgraph

* feat: initial stab at a Balancer V2 Sampler WIP

* feat: add sampling for buys and fix build issues WIP [untested]

* fix: BalancerV2Sampler implementation issues, works on Kovan

* chore: BalancerV2 sampling boilerplate

* fix: update Balancer V2 mainnet address

* fix: consolidate differences between the 2 working branches

* fix: use mainnet Balancer V2 subgraph

* fix: stack too deep by minimizing and inline Balancer V2 vault interface

* fix: address review comments and clean up

* fix: sampler vault interface and pools cache assuming a pool has swaps

* address more review comments

* fix: TS type issues and add a comment about deadline argument

* fix: pools_cache_tests incorrect token addresses, prettier incompat

* fix: make ERC20BridgeSampler support BalancerV2 non view sampler fns

* fix: use a struct for passing encoded bridge data for Balancer V2

* chore: add changelog entries

* fix: improve gas accuracy of gas schedule for Balancer V2 & Maker Psm

* fix: don't exclude sources with stale caches & wait for cache refresh

* rebase

* `@0x/asset-swapper`: Fix stack too deep errors in sampler

Co-authored-by: Kim Persson <kimpersson88@gmail.com>
Co-authored-by: Lawrence Forman <me@merklejerk.com>
2021-05-05 11:01:28 +02:00