59 Commits

Author SHA1 Message Date
Lawrence Forman
8006e4fe3b @0x/contracts-asset-proxy: Change proxy ID and add proxy signature to IAssetData. 2019-09-29 21:53:42 -04:00
Lawrence Forman
b50e26dc2a @0x/contracts-asset-proxy: Rename IERC20Bridge.transfer() -> IERC20Bridge.withdrawTo().
`@0x/contracts-asset-proxy`: Make `bridgeData` last parameter in `IERC20Bridge.withdrawTo()`.
`@0x/contracts-asset-proxy`: Reuse `PROXY_ID` as `BRIDGE_SUCCESS`.
2019-09-29 17:10:38 -04:00
Lawrence Forman
d6a4d67a14 @0x/contracts-asset-proxy: Add ERC20BridgeProxy and tests. 2019-09-27 19:33:33 -04:00
Alex Towle
b62486923f @0x:contracts-staking Removed storage assertions from Staking and moved them to a test contract 2019-09-24 18:12:00 -07:00
Amir Bandeali
b1c2f66126 Update variable names in IAssetData 2019-08-25 16:51:37 -07:00
Greg Hysen
41b372ffe6 Updates from staking PR review 2019-08-21 13:04:20 -07:00
Amir Bandeali
c366a4bd83 Update copyright dates 2019-08-20 12:49:01 -07:00
Amir Bandeali
2e97cfa5e5 Remove LibAssetProxyIds and TestLibConstants 2019-08-13 16:04:33 -07:00
Amir Bandeali
f757a9de52 Add devdoc comments to IAssetData 2019-08-06 15:51:59 -07:00
Alex Towle
5ba0e0dc54 Updated the structure of the archive directory 2019-08-03 16:33:28 -07:00
Alex Towle
47ab2a1b1d Reverted the asset-proxy back to an older version of Ownable that it was actually deployed with 2019-08-02 13:46:34 -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
858ccfa934 Disallow the zero address in MixinAuthorizable 2019-08-02 13:45:12 -07:00
Amir Bandeali
90d1decb87 Fix build errors 2019-07-24 10:26:28 -07:00
James Towle
4d1a942e79 Removed unnecessary files and code 2019-07-23 15:52:20 -07:00
James Towle
0395188aed Updated any remaining contracts using 0.5.5 to 0.5.9 2019-07-23 15:51:43 -07:00
James Towle
201dc7c28d Removed events from the Mixins in asset-proxy 2019-07-23 15:51:43 -07:00
James Towle
9ef55023f2 Removed all mixins/ directories from the repository 2019-07-23 15:51:43 -07:00
James Towle
5813bb9ca8 Updated any remaining contracts using 0.5.5 to 0.5.9 2019-07-23 15:46:16 -07:00
Amir Bandeali
3e461ac2e5 Rename internal and private functions 2019-07-23 15:21:14 -07:00
Amir Bandeali
a569815840 Fix assetData length check and improve readability 2019-07-17 09:37:42 -07:00
Greg Hysen
9e41c3093b Conforming to error codes in ERC1155 Proxy 2019-07-17 09:37:42 -07:00
Amir Bandeali
77484dc69e Implement ERC1155Proxy in Solidity 2019-07-15 22:08:08 -07:00
Amir Bandeali
54f4727adc Implement StaticCallProxy in Solidity 2019-07-15 22:07:15 -07:00
Amir Bandeali
323fb0a965 Bump solidity version pragma for undeployed AssetProxy contracts 2019-06-18 19:52:18 -07:00
Amir Bandeali
45aacf122f Fix StaticCallProxy comment and add sanity checks to TestStaticCallTarget 2019-06-18 19:52:18 -07:00
Amir Bandeali
7d9e43b2e1 Add TestStaticCallTarget for testing StaticCallProxy 2019-06-18 19:50:59 -07:00
Amir Bandeali
f0ecda1a48 Use more specific revert reason in ERC1155Proxy 2019-06-18 19:50:59 -07:00
Amir Bandeali
4ed111a7d4 Implement StaticCallProxy 2019-06-18 19:50:59 -07:00
Amir Bandeali
12afeb30ae Move LibAssetData to DevUtils package 2019-06-07 08:46:20 -07:00
Greg Hysen
46690f0c35 Made some comments more readable and fixed some spelling 2019-06-05 15:23:53 -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
dde4ed3754 More readability for 1155 proxy 2019-06-05 14:08:25 -07:00
Greg Hysen
b596e02752 readability cleanup 2019-06-05 14:08:25 -07:00
Greg Hysen
976be66dee Scale values while copying from calldata 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
be1b636e30 Improved readability of ERC1155 Proxy 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
Amir Bandeali
066f3bb646 Return MAX_UINT256 for unlimited allowances in all token standards 2019-05-28 17:01:54 -07:00
Amir Bandeali
7809cad6cb Fix linting errors and warnings 2019-05-26 17:59:53 -07:00
Amir Bandeali
543011c3de Modify batch allowances to take an array of spenders 2019-05-26 17:19:01 -07:00
Amir Bandeali
c9bf1eda54 Small readability and efficiency improvements 2019-05-26 15:33:55 -07:00
Amir Bandeali
2cd4d9004c Create LibAssetProxyIds 2019-05-26 14:39:31 -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
Greg Hysen
7ed3afe9f0 Updated function signature for ERC1155 ProxyId - ERC1155Token -> ERC1155Assets 2019-03-19 15:35:08 -07:00
Greg Hysen
e1cfbcd4f6 Copied MixinAssetProxyDispatcher from exchange 2019-03-15 21:16:21 -07:00