66 Commits

Author SHA1 Message Date
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
Xianny
7bf009fbf6
Upgrade to typescript v4.2.2 (#188)
* upgrade to typescript v4.2.2

* prettier; remove outdated test
2021-03-30 13:26:05 -07: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
Lawrence Forman
9b3781abf1 Cherry pick dydx validation from #2456 2020-02-19 15:45:27 -05: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
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
2fc449da4c Fix integrations tests build 2020-01-17 10:00:16 -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
Michael Zhu
c5b2991821 fix bug in finalizePool 2020-01-15 13:20:54 -08:00
Michael Zhu
c36d0fdc7c invalidWithdrawDelegatorRewardsAssertion 2020-01-15 13:20:54 -08:00
Michael Zhu
544e09cf4b invalidUnstakeAssertion 2020-01-15 13:20:54 -08:00
Michael Zhu
c110dc9e6a generic assertion for TRANSFER_FAILED reverts; _invalidStake generator 2020-01-15 13:20:54 -08:00
Michael Zhu
3bf37d6afd invalidDecreaseStakingPoolOperatorShareAssertion 2020-01-15 13:20:54 -08:00
Michael Zhu
b80ae5796b invalidCreateStakingPoolAssertion 2020-01-15 13:20:54 -08:00
Greg Hysen
46275a4f43 Minor fixes to order matching fuzz code 2020-01-14 17:32:10 -08:00
Greg Hysen
c09ac58ac0 Fuzz testing for matchOrders and matchOrdersWithMaximalFill. 2020-01-14 16:17:43 -08:00
Greg Hysen
e01d32ef1a added order matching functions to Taker actor. 2020-01-14 16:17:43 -08:00
Greg Hysen
aa8b14b7ee Added order martching to Maker actor. Also fixed the joinStakingPool to record the pool id. 2020-01-14 16:17:43 -08:00
Lawrence Forman
de12da18da
Exchange signature validation fuzz tests (#2425)
* `@0x/contracts-integrations`: Add Exchange signature validation fuzz tests.

* `@0x/contracts-integrations`: Switch from actor pattern to just pure function generators.

Co-authored-by: Lawrence Forman <me@merklejerk.com>
2020-01-07 17:35:25 -05:00
Greg Hysen
930b95a548 Added integration tests for DydxBridge with Exchange contract 2019-12-19 21:32:03 -08:00
Michael Zhu
701ba3902c add comments 2019-12-18 11:38:33 -08:00
Michael Zhu
bb3ec970a9 lint 2019-12-18 11:38:33 -08:00
Michael Zhu
1d023e6db5 Add optional parameter to sample and sampleSize 2019-12-18 11:38:33 -08:00
Michael Zhu
1bd906ecb3 Add optional distribution parameter to Pseudorandom.integer, use Kumaraswamy distribution for operator share 2019-12-18 11:38:33 -08:00
Alex Towle
47c3ed9705 Fixed the bug and moved "contracts-tests" to "contracts-integrations" 2019-12-17 19:02:57 -08:00
Michael Zhu
8ecbde8e1e Chagne StoredBalance functions to not mutate in place 2019-12-12 15:21:42 -08:00
Michael Zhu
a24b293818 register actors in the SimulationEnvironment constructor 2019-12-12 14:38:07 -08:00
Michael Zhu
e4a3b1cb05 fix bug in LibFractions reference function 2019-12-11 18:12:02 -08:00
Michael Zhu
49538f272e address comments 2019-12-11 16:54:48 -08:00
Michael Zhu
865a2b1fb0 add/update comments 2019-12-09 23:45:38 -08:00
Michael Zhu
1fde62eeb6 fix bug in finalizePool 2019-12-09 23:45:38 -08:00
Michael Zhu
6754cd48e2 refactor + fix lint 2019-12-09 23:45:38 -08:00
Michael Zhu
ccb477687a fixing bugs 2019-12-09 23:45:38 -08:00
Michael Zhu
1c2cb947c0 Add assertion generators to keeper, staker, taker mixins for the new function assertions 2019-12-09 23:45:38 -08:00
Michael Zhu
4663eec950 Add function assertions required for staking rewards fuzzing: withdrawDelegatorRewards, finalizePool, and endEpoch. Also adds payProtocolFee-related assertions to fillOrder 2019-12-09 23:45:37 -08:00
Michael Zhu
fff3c1eb36 update pool membership simulation to use multiple makers and takers, partial fills 2019-12-09 23:43:16 -08:00
Michael Zhu
130653a1aa move logger, pseudorandom, wrapper_interfaces to framework/utils/ 2019-12-09 23:42:32 -08:00
Michael Zhu
faf306ad23 Simulation logging, hopefully address function assertion lifetime issue 2019-12-09 23:42:32 -08:00
Michael Zhu
d11cdcd5d2 Use seeded rng for simulations 2019-12-09 23:42:32 -08:00
Amir Bandeali
5be0632e01 Add tests with multiple fee recipients 2019-12-04 21:23:55 -08:00
Xianny
fcbcbac889
Remove assetDataUtils everywhere (#2373)
* remove assetDataUtils everywhere

* export IAssetDataContract from @0x/contract-wrappers to allow @0x/instant to decode asset data  synchronously

* export generic function `decodeAssetDataOrThrow` and add ERC20Bridge support

* export `hexUtils` from order-utils instead of contracts-test-utils
2019-12-04 13:08:08 -08:00
Alex Towle
474399154f Addressed last review comment 2019-12-03 14:41:53 -08:00
Alex Towle
19f5153d0e Addressed some review feedback 2019-12-03 14:41:53 -08:00