diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-07-23 08:10:07 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-07-23 22:34:47 +0800 |
commit | c2ae9f62a41466c714a5e2232782d08261464b9c (patch) | |
tree | 54ae38ad5def1d47bb51fe7af417d3f82c57bf9f /packages/contracts/src/2.0.0 | |
parent | 4159a8fe6e621fa01ccac6b97778374be658d984 (diff) | |
download | dexon-sol-tools-c2ae9f62a41466c714a5e2232782d08261464b9c.tar dexon-sol-tools-c2ae9f62a41466c714a5e2232782d08261464b9c.tar.gz dexon-sol-tools-c2ae9f62a41466c714a5e2232782d08261464b9c.tar.bz2 dexon-sol-tools-c2ae9f62a41466c714a5e2232782d08261464b9c.tar.lz dexon-sol-tools-c2ae9f62a41466c714a5e2232782d08261464b9c.tar.xz dexon-sol-tools-c2ae9f62a41466c714a5e2232782d08261464b9c.tar.zst dexon-sol-tools-c2ae9f62a41466c714a5e2232782d08261464b9c.zip |
Add tests to verify ZRX_ASSET_DATA
Diffstat (limited to 'packages/contracts/src/2.0.0')
-rw-r--r-- | packages/contracts/src/2.0.0/test/TestConstants/TestConstants.sol | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/packages/contracts/src/2.0.0/test/TestConstants/TestConstants.sol b/packages/contracts/src/2.0.0/test/TestConstants/TestConstants.sol new file mode 100644 index 000000000..1275d007b --- /dev/null +++ b/packages/contracts/src/2.0.0/test/TestConstants/TestConstants.sol @@ -0,0 +1,57 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity 0.4.24; + +import "../../utils/LibBytes/LibBytes.sol"; + + +// solhint-disable max-line-length +contract TestConstants { + + using LibBytes for bytes; + + bytes4 constant internal ERC20_PROXY_ID = bytes4(keccak256("ERC20Token(address)")); + + address constant internal KOVAN_ZRX_ADDRESS = 0x6Ff6C0Ff1d68b964901F986d4C9FA3ac68346570; + bytes constant internal KOVAN_ZRX_ASSET_DATA = "\xf4\x72\x61\xb0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6f\xf6\xc0\xff\x1d\x68\xb9\x64\x90\x1f\x98\x6d\x4c\x9f\xa3\xac\x68\x34\x65\x70"; + + address constant internal MAINNET_ZRX_ADDRESS = 0xE41d2489571d322189246DaFA5ebDe1F4699F498; + bytes constant public MAINNET_ZRX_ASSET_DATA = "\xf4\x72\x61\xb0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe4\x1d\x24\x89\x57\x1d\x32\x21\x89\x24\x6d\xaf\xa5\xeb\xde\x1f\x46\x99\xf4\x98"; + + function assertValidZrxAssetData() + public + pure + returns (bool) + { + bytes memory kovanZrxAssetData = abi.encodeWithSelector(ERC20_PROXY_ID, KOVAN_ZRX_ADDRESS); + require( + kovanZrxAssetData.equals(KOVAN_ZRX_ASSET_DATA), + "INVALID_KOVAN_ZRX_ASSET_DATA" + ); + + bytes memory mainetZrxAssetData = abi.encodeWithSelector(ERC20_PROXY_ID, MAINNET_ZRX_ADDRESS); + require( + mainetZrxAssetData.equals(MAINNET_ZRX_ASSET_DATA), + "INVALID_MAINNET_ZRX_ASSET_DATA" + ); + + return true; + } +} +// solhint-enable max-line-length
\ No newline at end of file |