Commit Graph

16410 Commits

Author SHA1 Message Date
F. Eugene Aumson
153533f1d5 Fix bug in prior revision: wrong asset data
I tried to get fancy back in 5effc6ec90.
I changed something more than the single refactor targetted by the
commit, and it broke things!  This reverts part of that commit,
restoring clean runs of 0x API tests.
2020-04-22 11:58:09 -04:00
F. Eugene Aumson
11622c586a asset-s: Add RfqtRequestOpts.isIndicative 2020-04-22 11:58:09 -04:00
Lawrence Forman
7396bb508a Merge pull request #2540 from 0xProject/feat/contracts/zero-ex
ZeroEx: Universal proxy
2020-04-21 23:37:35 -04:00
Lawrence Forman
7df6530f3a @0x/contracrts-zero-ex: Address more review comments. 2020-04-21 22:29:46 -04:00
Lawrence Forman
80787456fa @0x/contracts-zero-ex: Fix comments. 2020-04-21 22:29:46 -04:00
Lawrence Forman
4446ac1ca3 @0x/contracts-zero-ex: Use (scaled) enums for storage IDs 2020-04-21 22:29:46 -04:00
Lawrence Forman
220039ab00 @0x/contracts-zero-ex: Allow any call target to bootstrap(). 2020-04-21 22:29:46 -04:00
Lawrence Forman
12f2250ab5 @0x/contracts-zero-ex: bootstrap() is now a temporary feature, registered in the ZeroEx constructor.
`@0x/contracts-zero-ex`: `bootstrap()` de-registers itself and self-destructs once it's called.
`@0x/contracts-zero-ex`: `bootstrap()` now takes arbitrary call data, but the callee is fixed in an immutable.
`@0x/contracts-zero-ex`: `bootstrap()` caller is fixed in an immutable.
`@0x/contracts-zero-ex`: `bootstrap()` only calls a single target.
`@0x/contracts-zero-ex`: Renamed `BasicMigration` to `InitialMigration`.
`@0x/contracts-zero-ex`: `InitialMigration` is now the bootstrap target and multiplexes to the initial features.
`@0x/contracts-zero-ex`: Add `Migrate` feature and tests.
`@0x/contracts-zero-ex`: Re-organize contract locatins (remove `interfaces` folder).
2020-04-21 22:29:46 -04:00
Lawrence Forman
0c33aa16a1 @0x/utils: Add more ZeroEx rich reverts.
`@0x/utils: Display revert error payload in stack traces.
2020-04-21 22:29:46 -04:00
Lawrence Forman
72908b02fe @0x/contracts-zero-ex: Address review feedback.
`@0x/contracts-zero-ex`: Add target implementation address to `rollback()`.
`@0x/contracts-zero-ex`: Add storage ID uniqueness test.
`@0x/contracts-zero-ex`: Add rollback history querying functions to `SimpleFunctionRegistry`.
2020-04-21 22:29:46 -04:00
Lawrence Forman
223aa04424 @0x/utils: Change SimpleFunctionRegistry NoRollbackHistoryError to NotInRollbackHistoryError. 2020-04-21 22:29:46 -04:00
Lawrence Forman
e53248cca6 @0x/sol-compiler: Address review feedback. 2020-04-21 22:29:46 -04:00
Lawrence Forman
c11d661b39 @0x/contracts-zero-ex`: Create ZeroEx (proxy) contracts 2020-04-21 22:29:46 -04:00
Lawrence Forman
4212a08337 @0x/contracts-utils: Add solidity 0.6 contracts 2020-04-21 22:29:46 -04:00
Lawrence Forman
c0553fa9eb Add @0x/contracts-zero-ex project to monorepo.
Tweak circleci config to avoid running out of memory.
2020-04-21 22:29:46 -04:00
Lawrence Forman
7f26fafed7 @0x/utils: ZeroExRevertErrors. 2020-04-21 22:29:46 -04:00
Lawrence Forman
3e9309c003 @0x/sol-compiler: Strip receive functions from 0.6 ABI output 2020-04-21 22:29:46 -04:00
Lawrence Forman
1017707475 ethereum-types: Update MethodAbi definition for solidity 0.6 2020-04-21 22:29:46 -04:00
F. Eugene Aumson
e8ff5da209 asset-swapper: update CHANGELOG 2020-04-21 01:49:28 -04:00
F. Eugene Aumson
03ed3ac1b0 Merge branch 'development' into rfq-t-indicative 2020-04-21 00:50:50 -04:00
F. Eugene Aumson
2c97208e74 asset-s: simplify type with ?, not |undefined
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2555#discussion_r411081841
2020-04-21 00:49:30 -04: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
F. Eugene Aumson
83289bc801 asset-s: consider falsey takerAddress as absent
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2555#discussion_r411543876
2020-04-20 22:56:44 -04:00
F. Eugene Aumson
ba2ac6a7b5 asset-s: Clarify indicative quote enablement
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2555#discussion_r411498729
2020-04-20 22:56:44 -04:00
F. Eugene Aumson
245b6da577 asset-s: Require RfqtRequestOpts.intentOnFilling
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2555#discussion_r411083497
2020-04-20 22:56:44 -04:00
F. Eugene Aumson
8875f924b0 asset-s: test requestRfqtIndicativeQuotesAsync 2020-04-20 22:56:44 -04:00
F. Eugene Aumson
ad7868ebe1 asset-s: clean up order faking for indicative RFQT
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2555#discussion_r411545804
2020-04-20 22:56:44 -04:00
F. Eugene Aumson
5effc6ec90 asset-swapper: extract method
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2555#discussion_r411514718
2020-04-20 22:56:43 -04:00
F. Eugene Aumson
4cc9ceabd2 asset-swapper: Rm unused ERC20BridgeSource.Rfqt
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2555#discussion_r410517580
2020-04-20 22:56:43 -04:00
F. Eugene Aumson
464c918134 asset-swapper: test RFQT indicative quote handling 2020-04-20 22:56:43 -04:00
F. Eugene Aumson
2456adcb68 asset-swapper: validate RFQT indicative quotes
Validate that the responses returned from maker endpoints both conform
to expected JSON schema data types and also have the expected asset
data, per the taker's request.
2020-04-20 22:56:43 -04:00
F. Eugene Aumson
45bc967f30 asset-swapper: Differentiate RFQT warning messages 2020-04-17 02:34:36 -04:00
F. Eugene Aumson
d6d4d29257 asset-swapper: RFQ-T indicative quotes
These changes have been exercised via mocha tests in the 0x-api repo.

Not sure why I had to add GetMarketOrdersRfqtOpts to the package
exports.  `yarn test:generate_docs:circleci` said:

$ node ./packages/monorepo-scripts/lib/doc_generate.js --package @0x/asset-swapper
GENERATE_DOCS: Generating Typedoc JSON for @0x/asset-swapper...
GENERATE_DOCS: Generating Typedoc Markdown for @0x/asset-swapper...
GENERATE_DOCS: Modifying Markdown To Exclude Unexported Items...
Error: @0x/asset-swapper package needs to export:
GetMarketOrdersRfqtOpts
From it's index.ts. If any are from external dependencies, then add them to the EXTERNAL_TYPE_MAP.
    at DocGenerateUtils._lookForMissingReferenceExportsThrowIfExists (/root/repo/packages/monorepo-scripts/lib/utils/doc_generate_utils.js:288:19)
    at DocGenerateUtils.<anonymous> (/root/repo/packages/monorepo-scripts/lib/utils/doc_generate_utils.js:255:34)
    at step (/root/repo/packages/monorepo-scripts/lib/utils/doc_generate_utils.js:32:23)
    at Object.next (/root/repo/packages/monorepo-scripts/lib/utils/doc_generate_utils.js:13:53)
    at fulfilled (/root/repo/packages/monorepo-scripts/lib/utils/doc_generate_utils.js:4:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
2020-04-17 02:34:36 -04:00
F. Eugene Aumson
33fdfdc8c0 asset-swapper: Extract method inferQueryParams
For use in upcoming implementation of indicative quotes.
2020-04-17 01:18:46 -04:00
F. Eugene Aumson
80c8712b2a asset-swapper: Rm unused field in SwapQuoterOpts 2020-04-17 01:18:28 -04:00
F. Eugene Aumson
957e3eb93c asset-swapper: Restructure RFQ-T request options
There's one subtlety here: apiKey has been moved to be within the rfqt
namespace, after talking to Fabio and discovering that he only needs to
re-use the API key in 0x API, not in asset-swapper.
2020-04-17 01:18:07 -04:00
F. Eugene Aumson
110e1afa8e Merge pull request #2541 from 0xProject/rfq-t
asset-swapper: RFQ-T firm quotes
2020-04-15 15:24:48 -04:00
F. Eugene Aumson
1da8f68871 migrations: Add independent yarn prettier script 2020-04-15 14:17:03 -04:00
F. Eugene Aumson
513ddb4cca Merge branch 'development' into rfq-t 2020-04-15 11:12:30 -04:00
F. Eugene Aumson
3bdfcb8542 Update {asset-s,migrat,contract-ad}* CHANGELOGs 2020-04-15 01:47:13 -04:00
F. Eugene Aumson
aee758eca2 Fix bug: Stop ignoring default SwapQuoteRequestOps
SwapQuoter._getSwapQuoteAsync() was merging defaults into the options
sent into SwapQuoteCalculator.calculateMarket{Buy,Sell}SwapQuoteAsync(),
but it was using the unmerged options function parameter for the RFQ-T
options and also for the gas price option.
2020-04-15 01:47:01 -04:00
Steve Klebanoff
47ef7fffce RFQ-T: validate assetData & add more tests (#2552)
* test for returning a 200 with invalid data, and additonal logging for that case

* Ensure RFQ-T response has asset data we expect

* validate signed order schema

* give more descriptive variable names and test an unsigned order

* takeout unused var
2020-04-15 00:11:37 -04:00
F. Eugene Aumson
58d6256607 Bug fix: RFQ-T orders werent going through sorting 2020-04-13 12:53:08 -04:00
F. Eugene Aumson
b854fcdb72 Remove an unnecessary type annotation 2020-04-13 12:53:08 -04:00
F. Eugene Aumson
27ca75d94f Clarify parallelization of orderbook & RFQT
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406955099
2020-04-13 12:53:08 -04:00
F. Eugene Aumson
bb15f78af0 Validate maker endpoint responses with JSON Schema
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406957115
2020-04-13 12:53:08 -04:00
F. Eugene Aumson
ccc9e18132 Type Axios response with undefined, not void
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406956436
2020-04-13 12:53:08 -04:00
F. Eugene Aumson
d55108ab60 Eliminate unnecessary else
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405906319
2020-04-13 12:53:07 -04:00
Steve Klebanoff
84adbcb683 asset-swapper: Mockable axios for QuoteRequestor (#2549)
* Mockable axios for QuoteRequestor

* Move RFQT Mocker to src

* move MockedRfqtFirmQuoteResponse into types file

* fix import
2020-04-10 23:09:56 -04:00
F. Eugene Aumson
0cb5e4553b Await Axios response so we don't circumvent catch
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406604110
2020-04-10 15:34:06 -04:00