37 Commits

Author SHA1 Message Date
Lawrence Forman
ac38390241 @0x/contracts-utils: Fix failing test due to rebase. 2019-08-06 15:31:30 -04:00
Lawrence Forman
8c9bdadf66 @0x/contracts-utils: Add unit tests for ReferenceFunctions. 2019-08-06 15:30:59 -04:00
Alex Towle
3915c7e8f2 Addressed final review comments 2019-08-04 23:45:02 -07:00
Alex Towle
9a35e2db77 Ran prettier 2019-08-02 13:46:34 -07:00
Alex Towle
6fc38292f2 Add RichErrors for Authorizable 2019-08-02 13:45:41 -07:00
Alex Towle
89d8df3385 Moved MixinAuthorizable to Authorizable and fixed imports 2019-08-02 13:45:41 -07:00
Alex Towle
9c7df2b41e Reverted MixinAuthorizable to old version and moved the new version to utils 2019-08-02 13:45:41 -07:00
Alex Towle
b4a3218b13 Disallow address zero in Ownable 2019-08-02 13:44:18 -07:00
Alex Towle
e1796a9f0f Changed toBN to toBigNumber 2019-08-01 15:39:00 -07:00
Alex Towle
8c5c81fe70 Change all instances of throw to revert in it tests 2019-08-01 15:13:16 -07:00
Alex Towle
77feaec444 Fixed lingering review comments 2019-07-31 13:59:33 -07:00
Alex Towle
3ca3a2820d Fixed review comments 2019-07-30 15:53:01 -07:00
James Towle
8cf4fb9adc Update contracts/utils/test/safe_math.ts
Co-Authored-By: Lawrence Forman <lawrence@0xproject.com>
2019-07-30 12:08:35 -07:00
James Towle
f044f364cb Update contracts/utils/test/reentrancy_guard.ts
Co-Authored-By: Lawrence Forman <lawrence@0xproject.com>
2019-07-30 12:08:35 -07:00
James Towle
4d39892a11 Update contracts/utils/test/ownable.ts
Co-Authored-By: Lawrence Forman <lawrence@0xproject.com>
2019-07-30 12:08:35 -07:00
James Towle
bf1ebe8e53 Update contracts/utils/test/ownable.ts
Co-Authored-By: Lawrence Forman <lawrence@0xproject.com>
2019-07-30 12:08:35 -07:00
James Towle
77b4f32274 Update contracts/utils/test/ownable.ts
Co-Authored-By: Lawrence Forman <lawrence@0xproject.com>
2019-07-30 12:06:35 -07:00
Alex Towle
b2ada13a21 Ran prettier 2019-07-30 12:06:35 -07:00
Alex Towle
03fced81f5 Added unit tests for LibRichErrors 2019-07-30 12:06:35 -07:00
Alex Towle
f9292a8fb8 Added unit tests for LibEIP712 2019-07-30 12:06:35 -07:00
Alex Towle
065f46a020 Added unit tests for LibAddress 2019-07-30 12:06:35 -07:00
Alex Towle
6efb7027b5 Added unit tests for ReentrancyGuard 2019-07-30 12:06:35 -07:00
Alex Towle
f4f922acb5 Added unit tests for Ownable 2019-07-30 12:06:35 -07:00
Alex Towle
4a4d2e7079 Added unit tests for SafeMath 2019-07-30 12:06:35 -07:00
James Towle
f937a0b038 @0x:contracts-utils Added RichErrors to ReentrancyGuard 2019-07-23 15:53:25 -07:00
James Towle
da38285046 @0x:contracts-utils Added RichErrors to LibAddressArray 2019-07-23 15:53:25 -07:00
James Towle
d3db2dcfbb @0x:contracts-utils Added RichErrors to LibBytes 2019-07-23 15:53:25 -07:00
F. Eugene Aumson
0de2b6983b
Add LibAssetData to contracts/asset-proxy (#1779)
* Stop restarting node unnecesssarily during test

* Add new, empty LibAssetData

* Support encoding & decoding of ERC20 asset data

* Support encoding & decoding of ERC721 asset data

* Support encoding & decoding of ERC1155 asset data

* Support encoding & decoding of multi-asset data

* Support querying ERC20 balance from asset data

* Support querying ERC721 balance from asset data

* Support querying ERC1155 balance from asset data

* Support querying balance from multi-asset data

* Support querying ERC20 allowance from asset data

* Support querying ERC721 allowance from asset data

* Support querying ERC1155 allowance from asset data

* In tests, wait for allowance set before checking

* Introduce temporary variable `assetDataBody`

* Handle edge case in multi-asset balance query

* Support multi-asset allowance query by asset data

* Move variable declaration up for readability.

* Make all solhint-disable's cite specific rules

And move the directives to the ends of lines whenever possible

* Rename query tests to include " by asset data"

* Extract test helper method

* Extract another test helper method

* Support batch queries of allowances & balances

* In LibAssetData.sol, use IERC1155, not ...Mintable

* Rename balance*() return vars: amount -> balance

* Fix bug in ERC721 balance query

Was using method balanceOf(), but needed to be using ownerOf().

getERC721TokenOwner() method lifted from
@0x/extensions/contracts/src/OrderValidator/OrderValidator.sol

* Reuse new en/decoders; avoid abi.decode().

* Start lowest allowance/balance from 0, not MAX_INT

* Properly implement ERC1155 balance querying

* Split lines for readability

* Also check isApprovedForAll in 721 allowance query

* Add neglected division of allowances by amounts

* Rename methods: balanceOf -> getBalance

* Rename methods: allowance -> getAllowance

* Add methods: getBalanceAndAllowance() & batch...()

* Rename return vars: amount -> allowance

* Add devdoc comments

* Rename batchGet* methods to getBatch*

* Remove refactoring relic

* Add revert messages to all require() calls

* Reduce gas usage for ERC1155 asset data decoding

* Don't use dockerized solc for ERC20 contracts

Because they demand solc version 0.4.26, and it seems as though the tag
for that version has been deleted from dockerhub.

Without this, @0x/contracts-erc20 was failing to build.

* Rename batch functions to use plurals

* Skip dockerized solc for contracts needing 0.4.26

I seems as though the tag for that version has been deleted from
dockerhub.

Without this, these contracts were failing to build.

* Make revert reasons follow snake case convention
2019-04-29 15:46:26 -04:00
Jacob Evans
548089888d
Remove excess web3providernegine polling from contracts 2019-03-21 11:50:19 +01:00
Lawrence
4b2488b124 Ran prettier. 2019-03-20 10:58:25 -04:00
Lawrence
6ed1412bdd Remove unnecessary copy operation in TestLibAddressArray.testAppendRealloc().
Test explicitly for newly allocated address in LibAddressArray "append" tests.
2019-03-20 10:19:46 -04:00
Lawrence
b8925baa88 Add unit tests for contracts/utils/LibAddressArray.
Fix `LibAddressArray.indexOf` returning wrong index.
2019-03-20 10:19:46 -04:00
Amir Bandeali
8279ef0e05 Add more slice tests 2019-02-25 10:12:59 -08:00
Amir Bandeali
64401f1031 Fix bug in slice functions that disallow slicing the last byte of a byte array 2019-02-25 09:59:25 -08:00
Amir Bandeali
0758f231e2 Split tokens package into erc20 and erc721 2019-01-21 21:41:21 -08:00
kao
f14603ca4d Implement prefer-template tslint rule 2018-12-07 17:06:52 -08:00
Leonid Logvinov
e8d0aff333
Refactor @0x/contracts-utils from @0x/contracts-core 2018-12-04 14:41:18 +01:00