52 Commits

Author SHA1 Message Date
F. Eugene Aumson
f11d8a5bd8
@0x/order-utils refactors for v3: orderParsingUtils, signatureUtils, orderHashUtils, RevertErrors, transactionHashUtils (#2321)
* move orderParsingUtils from order-utils to connect

* Remove many functions from signatureUtils

Removed from the exported object, that is.  All of them are used in
other existing code, so they were all moved to be as local to their
usage as possible.

* remove orderHashUtils.isValidOrderHash()

* Move all *RevertErrors from order-utils...

...into their respective @0x/contracts- packages.

* Refactor @0x/order-utils' orderHashUtils away

- Move existing routines into @0x/contracts-test-utils

- Migrate non-contract-test callers to a newly-exposed getOrderHash()
method in DevUtils.

* Move all *RevertErrors from @0x/utils...

...into their respective @0x/contracts- packages.

* rm transactionHashUtils.isValidTransactionHash()

* DevUtils.sol: Fail yarn test if too big to deploy

* Refactor @0x/order-utils transactionHashUtils away

- Move existing routines into @0x/contracts-test-utils

- Migrate non-contract-test callers to a newly-exposed
getTransactionHash() method in DevUtils.

* Consolidate `Removed export...` CHANGELOG entries

* Rm EthBalanceChecker from devutils wrapper exports

* Stop importing from '.' or '.../src'

* fix builds

* fix prettier; dangling promise

* increase max bundle size
2019-11-14 17:14:24 -05:00
Xianny
f0d7d10fe7
update abi-gen with new method interfaces (#2325)
* update abi-gen with new method interfaces

* wip: get all packages to build

* wip: get all packages to build

* Fix two contract wrapper calls

* Export necessary types part of the contract wrapper public interfaces

* Revive and fix wrapper_unit_tests

* Remove duplicate type

* Fix lib_exchange_rich_error_decoder tests

* Fix remaining test failures in contracts-* packages

* Prettier fixes

* remove transactionHelper

* lint and update changelogs

* Fix prettier

* Revert changes to reference docs

* Add back changelog already published and add revert changelog entry

* Add missing CHANGELOG entries

* Add missing comma

* Update mesh-rpc-client dep

* Update Mesh RPC logic in @0x/orderbook to v6.0.1-beta

* Align package versions
2019-11-14 11:22:29 -05:00
fabioberger
6324a92ec5 Refactor contracts-* exports so none in test dir so npmignore works as intended 2019-11-11 21:49:29 +00:00
fabioberger
86b76a3e75 Introduce publicFacingContracts config in all package.jsons, refactor all imports from src in contracts packages 2019-11-11 15:10:15 +00:00
Xianny
6a852ab0ed
Replace assetDataUtils with DevUtilsContract wherever possible (#2304)
* Replace assetDataUtils with DevUtilsContract wherever possible

Does not replace from @0x/instant and some @0x/order-utils uses

* Add revertIfInvalidAssetData to LibAssetData

This is needed to replace `assetDataUtils.decodeAssetDataOrThrow`.
Because it's used in packages and not only contracts, we should wait
to deploy the updated contract so we can update `@0x/contract-artifacts`,
`@0x/abi-gen-wrappers`, and `@0x/contract-wrappers` first.

* remove usages of signatureUtils

* fix test for  optimised encoding

* refactor @0x/contracts-integrations

* update changelogs

* Move @0x/contracts-dev-utils from devDependencies to dependencies
It is exported as part of the package
2019-11-06 19:40:20 -08:00
Xianny
0e90b0e7d0
Make wrappers small again (#2243)
* introduce --debug option to abi-gen and remove debug functions from @0x/abi-gen-wrappers
* make evmExecAsync protected; ignore deployedBytecode in doc comment
* trim deployedBytecode so it's undefined unless a contract has pure functions
* remove validateAndSendTransactionAsync
* Create `AwaitTransactionSuccessOpts` and `SendTransactionOpts` types 
* Remove duplicate types `IndexedFilterValues`, `DecodedLogEvent`, `EventCallback` from `@0x/base-contract`
2019-10-16 09:38:34 -07:00
Michael Zhu
078b1af04e Binop -> BinOp 2019-08-26 16:06:31 -07:00
Michael Zhu
98e5b26eb7 refactor SafeMath rich errors and use them in staking libs 2019-08-26 15:49:09 -07:00
Alex Towle
22c8a25a26 Merge branch 'development' into 3.0 2019-08-19 11:13:21 -07:00
Lawrence Forman
9b5ba6806f @0x/contracts-asset-proxy: Fix broken erc1155_proxy tests.
`@0x/contracts-asset-proxy`: Add `ERC1155Proxy.sol` to .solhintignore.
Fix circleci config to work with 3.0 branch.
2019-07-29 23:47:04 -04:00
Greg Hysen
d8cf9d54aa Updated all instances of deployFrom0xArtifactAsync 2019-07-29 12:07:28 +02:00
Xianny
46384ce80d
Allow generated wrappers to subscribe/unsubscribe to events (#1970)
* Define SubscriptionManager and instantiate in generated wrappers

* expose subscribe/unsubscribe in generated wrappers

* update changelogs

* use SubscriptionManager in `@0x/contract-wrappers`
2019-07-26 16:54:31 -07:00
James Towle
a46b13967a Refactored the SafeMath errors 2019-07-23 15:51:43 -07:00
James Towle
83bd5f5561 Fixed the last broken test in asset-proxy 2019-07-23 15:51:43 -07:00
James Towle
0ddb9f8923 Added a linting command for slower computers 2019-07-23 15:51:43 -07:00
James Towle
03ea97734c Ran yarn prettier 2019-07-23 15:51:43 -07:00
James Towle
666b992c51 Readded Underflow RichErrors to asset-proxy 2019-07-23 15:51:43 -07:00
James Towle
aa36ebf4f2 Removed RichErrors from the erc1155 test in Authorizable 2019-07-23 15:51:43 -07:00
James Towle
cf3790c2f8 Updated the erc1155 tests in asset-proxy to use RichErrors 2019-07-23 15:51:43 -07:00
Amir Bandeali
10d767c5ab Update ERC1155Proxy tests 2019-07-15 22:08:23 -07:00
Amir Bandeali
0c8bb2e675 Add unit tests for StaticCallProxy 2019-06-18 19:50:59 -07:00
Greg Hysen
cfc4e345cc ran prettier and updated changelog 2019-06-05 14:22:50 -07:00
Greg Hysen
c68278d824 Additional multiplication overflow checks 2019-06-05 14:09:09 -07:00
Greg Hysen
09600a71cd Added tests to assert that assetData is within the boundaries of calldata 2019-06-05 14:08:25 -07:00
Greg Hysen
d66ba70f5e Updated length to match comment + added explicit test 2019-06-05 14:08:25 -07:00
Greg Hysen
e7c4120d24 Validation checks for the length of asset data 2019-06-05 14:08:25 -07:00
Greg Hysen
1212e534a8 Adds boundary checks when copying dynamic fields (includes tests) 2019-06-05 14:08:25 -07:00
Greg Hysen
899d0f1e42 removed .only for tests 2019-06-05 14:08:25 -07:00
Greg Hysen
b596e02752 readability cleanup 2019-06-05 14:08:25 -07:00
Greg Hysen
d5afe696da removed .only from tests 2019-06-05 14:08:25 -07:00
Greg Hysen
98c8a6387a manually copy ids, values, and data fields 2019-06-05 14:08:25 -07:00
Greg Hysen
8bae0b81aa Added ERC1155Proxy tests when data overlaps values in asset data 2019-06-05 14:08:25 -07:00
Greg Hysen
7ee19e1306 Added new tests for different lengths of receiver callback data, since we are now appending scaledValues after data. 2019-06-05 14:08:25 -07:00
Greg Hysen
626d0dfa93 Store scaled values and end of calldata in ERC1155 Asset Proxy 2019-06-05 14:08:25 -07:00
Fabio Berger
84d38ea878 Add assertions to abi-gen templates and fix tests 2019-06-04 13:18:01 +01:00
Lawrence Forman
4d493eeebd In @0x/contracts-asset-proxy: Update tests to use contract-built-in awaitTransactionSuccessAsync(). 2019-04-28 22:25:12 -04:00
Greg Hysen
7ed3afe9f0 Updated function signature for ERC1155 ProxyId - ERC1155Token -> ERC1155Assets 2019-03-19 15:35:08 -07:00
Greg Hysen
98c6fa10e6 Added 1explicit ERC1555Poxy testsfor cwhen receiver allback data is NULLL (0x) 2019-03-19 09:37:16 -07:00
Greg Hysen
22bc1fb21e additional zero outcome tests 2019-03-15 15:05:52 -07:00
Greg Hysen
63ba764de8 renamed perUnitValue to valueMultiplier 2019-03-15 15:05:52 -07:00
Greg Hysen
6a7530d741 added test for amount=0 2019-03-15 15:05:52 -07:00
Greg Hysen
9207d1c680 Do not revert if value or amount are zero. Only if amount is non-zero and there is an overflow. 2019-03-15 15:05:52 -07:00
Greg Hysen
9ec380777a Rebased against development 2019-03-15 15:05:02 -07:00
Greg Hysen
1e5648111e Updated changelogs and documentation for erc1155 proxy 2019-03-15 15:05:02 -07:00
Greg Hysen
ae51cfe8b9 Added method descriptions to erc1155 proxy wrapper 2019-03-15 15:05:02 -07:00
Greg Hysen
05ef250ab4 Ran prettier & linter 2019-03-15 15:05:02 -07:00
Greg Hysen
38e4871f32 Moved transferFrom with/without logs into ERC1155 Proxy Wrapper 2019-03-15 15:05:02 -07:00
Greg Hysen
a86ba7af2e moved transferFrom into ERC1155 Proxy Wrapper 2019-03-15 15:05:02 -07:00
Greg Hysen
55c4fc9aca Ran prettier / linter 2019-03-15 15:05:02 -07:00
Greg Hysen
888c17353b Renamed erc1155token to erc1155Contract in proxy tests 2019-03-15 15:05:02 -07:00